We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3293
    • 8 Posts
    hi i have a blog list page which successfully displays
    blog title [+title+]
    author [+author+]
    published date [+date+]
    summary of the blog [+summary+]
    read more link [+link+]


    the above things are controlled via ditto template (myditto1).

    when each blog link is clicked it displays the full blog page with
    blog title [*pagetitle*]
    published on [*pub_date*]
    full content of the blog [*content*]


    the above things are controlled from this blog template

    im using following ditto call in the parent blog page in the modx

    [[Ditto? &startID=`50` &summarize=`2` &removeChunk=`Comments` &tpl=`myditto1` &paginate=`1` &extenders=`summary,dateFilter` &paginateAlwaysShowLinks=`1` &tagData=`documentTags` &dateSource=`pub_date` &dateFormat=`%d %B %Y` ]]

    Showing [+start+] - [+stop+] of [+total+] Articles
    [+previous+] [+pages+] [+next+]



    NOW the problem is the published date in the full blog page is displayed as O. I dont no why published date is not displayed in the full blog page whereas it displays fine in the blog list page though.

    will be grateful if somebody could please assist me. i checked through the AuthorTime stamp here http://modxcms.com/forums/index.php/topic,3588.msg34361.html#msg34361 but i dont no where to put the code or how to use it
      • 7231
      • 4,205 Posts
      Download the txt file for the dateTime snippet and install it in the manager (copy + paste the code in a new snippet).

      then in the post page add:
      published on [[dateTime? &format=`%d %B %Y` &timestamp=`[*pub_date*]`]]

      Note, I recommended the dateTime snippet because it is simpler and does not require a tpl chunk for the output, it simply returns the date. But AuthorTime will also work.
        [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

        Something is happening here, but you don't know what it is.
        Do you, Mr. Jones? - [bob dylan]
        • 3293
        • 8 Posts
        its displaying 01 January 1970.

        i dont no why?
          • 7231
          • 4,205 Posts
          that is the default php time stamp...are you sure that the pub_date is set? This is only set if you use the ’publishe on’ setting for the document in question. The +date+ placeholder in Ditto will reert to other time options if it finds one empty which may be why it seems to be working in the Ditto tpl.

          If you want to simply use teh date when the document was published, then use [*publishedon*] rather than [*pub_date*].
            [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

            Something is happening here, but you don't know what it is.
            Do you, Mr. Jones? - [bob dylan]
            • 3293
            • 8 Posts
            Quote from: bickyz at Jun 29, 2009, 09:28 AM

            its displaying 01 January 1970.

            i dont no why?
            sorted, i changed
            [[dateTime? &format=`%d %B %Y` &timestamp=`[*pub_date*]`]]
            to
            [[dateTime? &format=`%d %B %Y` &timestamp=`[*createdon*]`]]

            thanks dev_cw.
              • 27629
              • 17 Posts
              Im having problmes with this, that i can’t resolve, id appreciate any help with this one...

              Installed DateTime Snippet, have a custom news/blog template in whihc i have
                <div class="ditto_documentInfo">posted by <strong>[+author+]</strong> on [[DateTime? &format=`%d %b %Y` &timestamp=`[*createdon*]`]]</div>
              


              This returns the date result 26 Oct 2005 for all posts, it wont return the actual createdon date?

              If i change to *pub_date* i just get the 01 January 1970 date.

              Any ideas?
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                Keep in mind that Ditto is running on the page it is called on; let’s say document 4 has your Ditto call. MODx will process [*...*] tags, which will get the variable for the current document, which is document 4.

                Now, Ditto is processing documents, one at a time. Every time [*...*] gets processed, it’s still for the current document MODx is parsing, document 4. The correct tags for getting the variables for Ditto’s processing is [+...+]; Ditto will replace these tags with the value for each document it is processing.

                So you have the MODx parser processing the current document to generate the web page, and it uses [*...*] for the values for that document. Ditto does its own processing of the pages you tell it to one at a time, using [+...+] placeholders for each one.
                  Studying MODX in the desert - http://sottwell.com
                  Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                  Join the Slack Community - http://modx.org
                  • 27629
                  • 17 Posts
                  Thanks for the reply Sottwell,

                  I’ll play with this some more and if i still can’t figure it out ill post back.

                  Gotta say the help on here is great (i think you have answered all my posts Sottwell) smiley
                    • 15599
                    • 27 Posts
                    What about displaying the author’s name in the post?
                      • 36592
                      • 970 Posts
                      Try AuthorTimestamp snippet.