We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21112
    • 156 Posts
    Is it possible for ditto to output only the ID if the most recent article of the given parent? I wish to create a link from my site navigation to the newest article in a certain category, and I was wondering if I could use a ditto call in the link to do this?

    Thanks in advance.
      • 18397
      • 3,250 Posts
      Yes, Ditto can do this. Use the following call on Ditto 2:

      [!Ditto?display=`1`&tpl=`only_id`!]
      


      The chunk ’only_id’
      [+id+]
      

        • 21112
        • 156 Posts
        Brilliant! That worked perfectly.

        This is the ditto call I used in the ’weblink’ field:
        [~[!Ditto?display=`1`&parents=`46`&sortBy=`pub_date`&tpl=`only_id`!]~]


        MODx and Ditto amaze me every day with their flexibility and power! Great work, and thank you for the help!