We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28513
    • 53 Posts
    Hey guys. I have got ditto working pretty good on my site but I have a few questions.

    look here for reference - http://stevemullencreative.com/modx/index.php?id=2

    1.) How do I show the full year, 2009 instead of just 09.

    2.) Can I change the date displayed? I am trying to add modx to my existing site and once I got live I don’t want it to look like anything has changed. So how can I make the post date go back in time? I tried setting a past publish date on the page in the admin but that did not seem to do the trick.

    3.) This one may be a little more complicated. On the right rail in the above link, I am showing 4 posts. I got that working with ditto to limit it to 4, but probably not in the way that I want. I want it to show the 4 most recent, and then all older ones will fall under the next heading or More Posts. How would I handle that functionality?

    Thanks for your help guys. You have already helped a ton pointing me towards ditto!

    -Steve
      • 36571
      • 145 Posts
      Hello Steve,

      In response to your questions:

      1) You can specify the date format in the &dateFormat parameter in your Ditto call. You can use any strftime format.

      2) Your on the right track. After setting the publish dates, you then have to tell Ditto to use this as the source of its dates. You can do this by setting &dateSource=`pub_date`

      3) To change the order, you should use &orderBy parameter. Again, set this to pub_date and it should work.

      You can see all the Ditto parameters here: http://ditto.modxcms.com/files/snippet-ditto-php.html
        • 28513
        • 53 Posts
        Thank you very much daniel. I will take a look at those in detail soon.

        As for the date format I was able to modify the format using the &dateFormat param to shot "Oct 29 09" for example but I could not figure out right format for "Oct 29 2009"

        Thanks again.
          • 15022
          • 31 Posts
            illegitimati non carborundum