We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7392
    • 4 Posts
    great work so far! it looked like it was ’drop-in-and-runwith-it’, but I came up with a weird snag. my chunk looks like so:

    <h3><a href="index.php?id=[+id+]">[+pagetitle+]</a></h3> - created by [+createdby+] on [+createdon+]

    [+introtext+]

    ...and all the replaceable variables appear in modx_site_content. *but* this is what i see on the page:

    Programming, Hungarian Style! - created by 1 on 1143990971
    Learn an old-skool method on how to keep your code readable!

    ...notice the numerical ’createdby’ and ’createdon’ content. any clue on what i missed in setting up the snippet?
    huh
      • 22097
      • 37 Posts
      You missed nothing.. The snippet just replaces the vars by the values found in the database, and those number are how MODx stores those. If you want to show the real thing there you will need extra calls (for instance to find out the name of use 1, and what date goes with the number you got).
      The date part is easy, that could be done by using the date() function in PHP. See www.php.net/date. It will require some programming, as the snippet can’t know the type of the variable you are showing.
        • 7392
        • 4 Posts
        doh- this is what i get for tinkering at odd hours of the night. it just dawned on me that this was raw output. undecided

        after some sleep i’ll take a crack at whipping up a little sub-snippet to convert the id to the creator’s name.

        thanks for the reply!
          • 18397
          • 3,250 Posts
          NewsListing handles all that for you if you wish to use it.
            • 33114
            • 518 Posts
            Quote from: sottwell at Apr 01, 2006, 12:53 AM

            Quote from: yentsun at Mar 31, 2006, 04:15 PM

            I suppose if I have a TV with, say  @INHERIT  value this snippet won’t reneder it properly?:)
            It will reneder the TV like  "@INHERIT".

            Has this been tested?

            yep... As said by Olaf - this snip will reneder just the content of a TV, not the output format of it. And if we dig a litlle deeper - this is caused by the existence of getDocumentChildrenTVars func and missing the existence of getDocumentChildrenTVarsOutput func. If I’m not mistaken smiley
              http://modx.ru - российская поддержка MODx
              http://newscup.ru - экспериментальный проект
              http://yentsun.com - персональный сайт
              • 6726
              • 7,075 Posts
              Theo, I just realized you didn’t add 1.3.1 to the repository, which is too bad... could you do that please ?
                .: COO - Commerce Guys - Community Driven Innovation :.


                MODx est l&#39;outil id