We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36571
    • 145 Posts
    Hey all. Wondering if anyone could help me out on this one.

    Is there a way to dynamically change the TV that ditto is ordered by?

    I have a various template variables that I would like to use for sorting, preferably using a single ditto call.

    The visitor would see the ditto output, and then be able to click a link (e.g. sort by price, sort by colour) and it would re-sort the output based on what they clicked.

    Hope this makes sense. Any help appreciated.

    Cheers.

      • 7231
      • 4,205 Posts
      You could do this in many ways. The native Ditto method using the request extender
      Adds support for changing Ditto parameters via URL
      Or you could use a snippet to read the request string and output it in the Ditto snippet call.
        [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]
        • 36571
        • 145 Posts
        Tried adding ?ditto_sortBy=price to the end of the URL and it worked a treat.

        Thanks so much.