We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32127
    • 11 Posts
    Hi all,

    I want to show a blog-like list on my site using Ditto. Every blog items will describe a project I did for clients.
    These projects have been done in the past.
    If I add new documents, they all het the date and time of [now]. Ditto shows the date with the [+date+] code...

    Is it possible to change the date and time of a document te reflect the date we did the project?
    Or, is the solution this: remove the date from the ditto template and add the date manually in the content...?

    Thanks,
    Rene
      Ren
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      How about setting the publish_date for when you did the project, then get Ditto to display that?
        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
        • 32127
        • 11 Posts
        Quote from: sottwell at Jan 21, 2008, 09:21 AM

        How about setting the publish_date for when you did the project, then get Ditto to display that?
        Thanks. I’ll give that a try...
          Ren
          • 25663 MODX Staff
          • 12,272 Posts
          Use the Doc Manager module to change dates if you still need to do so.
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 32127
            • 11 Posts
            Quote from: sottwell at Jan 21, 2008, 09:21 AM

            How about setting the publish_date for when you did the project, then get Ditto to display that?
            Hello sotwell,

            I tried this in my template:
            <div class="ditto_summaryPost">
              <h3><a href="[~[+id+]~]" title="[+title+]">[+title+]</a></h3>
              <div class="ditto_info" ><?php echo strftime("%d-%m-%Y",[+pub_date+]); ?>.</div>
              [+summary+]
              <p class="ditto_link">[+link+]</p>
            </div>


            But it doesn’t display a date. Any suggestions what I did wrong?
              Ren
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              MODx doesn’t use regular php tags like that. You’ll need to use phx in the placeholder to format the timestamp.
              [+pub_date:date=`%d.%m.%Y`+]

              http://wiki.modxcms.com/index.php/PHx#date.28.3D.60dateformat.60.29
                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
                • 32127
                • 11 Posts
                Thanks! That did it!
                  Ren