We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20001
    • 18 Posts
    Hi! Hope there is someone willing to answer my really newbie questions:) Issues:

    1) Cannot seem to get the published date out of the returned results.
    2) sortBy does not work for anything, [[Ditto?&sortBy=`publishedon`]] or [[Ditto?&sortBy=`menuitem`]] it just defaults and shows in the order created. I can change it in the snippet but we all know that is a big rookie mistake, help.

      • 18397
      • 3,250 Posts
      1) Do you mean you want to display the published date in the template? If so, use &dateSource=`publishedon`
      2) You must use a valid field for sortBy. Menuitem is not one. Menuindex is. publishedon should work. What Ditto version are you using?
        • 8960
        • 150 Posts
        Here’s the correct parameter list. As Mark said, you’re using ones that don’t exist.
          • 20001
          • 18 Posts
          Thank you all!

          1) Do you mean you want to display the published date in the template? If so, use &dateSource=`publishedon`

          *Want to take the date completely out. Ditto version 2.0.2

          2) You must use a valid field for sortBy. Menuitem is not one. Menuindex is. publishedon should work. What Ditto version are you using?

          *Menuindex, works like a champ:)
            • 18397
            • 3,250 Posts
            This is the correct parameter list.

            To remove the date, follow the steps here while omitting the [+date+] placeholder.
              • 1008
              • 19 Posts
              Can you sort by pagetitle?
                • 36926
                • 701 Posts
                Whats the difference between &sortBy and &orderBy?
                  • 1008
                  • 19 Posts
                  I think sortBy is just related to TVs or any other document variable.
                    • 7231
                    • 4,205 Posts
                    &orderBy uses the same format as the sql statement ORDER BY, for example
                    &orderBy=`pagetitle ASC`

                    &sortBy is the old method and needs two parameters to do the same thing
                    &sortBy=`pagetitle` &sortDir=`ASC`


                    Not sure, but you may also be able to use multiple criteria in orderBy like &orderBy=`pagetitle, pub-date DESC` but I haven’t tested this yet...I wouldn’t be surprised that it works wink
                      [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]