We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29676
    • 45 Posts
    I’m using ditto to produce a blog page like this .. http://80.247.1.230/article-1236772311.html

    But I need to display the following on each individual blog page (all works fine on the summary of the blog entries, see http://80.247.1.230/blog.html

    Title of the post

    Date posted/published

    Thanks

      • 25663 MODX Staff
      • 12,272 Posts
      You can probably just insert [*pagetitle*] for the title and [*pubdate*] for the date.
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 29676
        • 45 Posts
        mm - pagetitle works, but not pubdate ..

        http://80.247.1.230/article-1236772311.html

        added ..
        <p>pagetitle .. [*pagetitle*]</p>
        <p>pubdate .. [*pubdate*]</p>

          • 25663 MODX Staff
          • 12,272 Posts
          Here’s a complete list of document object variables from the documentation link in the forums header:

          http://svn.modxcms.com/docs/display/MODx096/Document-Specific+Template+Variables

          (I think it’s actually either [*published_on*] or [*publishedon*] which is actually missing from the wiki docs ... )
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 29676
            • 45 Posts
            [*publishedon*] produces 0

            The document you refer to says # pub_date- Date the document is to be published. This is not a "normal" date, and must be processed by a script for meaningful output.

            Example: strftime("%d/%m/%y %H:%M:%S", $value)

            But I don’t know the correct syntax to place that in a template - I’m learning how to use these chunks/snippets and so on but it’s not easy for a newbie!

            Any help appreciated!

            Steve
              • 36592
              • 970 Posts
              Quote from: rthrash at Mar 12, 2009, 07:56 AM

              ... and [*pubdate*] for the date.
              Isn’t it [*pub_date*] ?
                • 29676
                • 45 Posts
                [*pub_date*] produces what looks like the article reference no of the page, ie: 1236772273
                  • 36592
                  • 970 Posts
                  Quote from: thecubelab at Mar 13, 2009, 03:36 AM

                  [*pub_date*] produces what looks like the article reference no of the page, ie: 1236772273
                  That’s correct.

                  If you want to display it in human readable form, use DateTime snippet.
                  http://modxcms.com/DateTime-884.html
                    • 29676
                    • 45 Posts
                    Can you outline the correct syntax for that please?

                    I assume I create a snippet called Date Time and call it from the page (or template in this case) but how does it relate to the actual published time?

                    Please be more specific as the page you referred to seems to only output the current date/time?

                    I’m not a php programmer as my skills only go as far as css and html but I’m slowly ’getting it’ smiley
                      • 3707
                      • 241 Posts
                      You could try using PHx to format the date e.g. [*pub_date:date=`%d.%m.%Y`*]