We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16311
    • 28 Posts
    Is there anyway to setup Ditto such that content editors can define the order in which each document is displayed? My only thought is that I could have Ditto sort by a TV, into which the user could enter a ’priority’ number. However I’m not sure how to set that up, does the tv that ditto sorts by need to be displayed in the ditto template? Is there a better way to do this?
      • 18397
      • 3,250 Posts
      "My only thought is that I could have Ditto sort by a TV, into which the user could enter a ’priority’ number. "

      This is the most logical approach. To set this up create a TV called sort with a default value of 0.

      Then append &sortBy=`tvsort` to your Ditto call and Ditto will take care of the rest.
        • 16311
        • 28 Posts
        Quote from: Mark at Jan 14, 2007, 12:33 PM

        "My only thought is that I could have Ditto sort by a TV, into which the user could enter a ’priority’ number. "

        This is the most logical approach. To set this up create a TV called sort with a default value of 0.

        Then append &sortBy=`tvsort` to your Ditto call and Ditto will take care of the rest.

        I’ve done as you suggested, however I still can’t get Ditto to change its order - It still displays the content in descending doc id order, despite my having specified different numbers in the ’sort’ fields. The structure of my documents is as follows:

        <parent doc containing ditto call>
        - <content doc 1> (The template that these content docs use has the ’sort’ tv attached to it)
        - <content doc 2>
        - <content doc 3>
        - etc

        My ditto call looks like this:
        [!Ditto?&tpl=`box_product_temp`&summarize=`50`&sortBy=`tvsort`!]


        Is there something I’m missing, or extra parameters that Ditto needs?
          • 16311
          • 28 Posts
          Anyone got any ideas on this? I’m still stuck trying to get Ditto to take notice of the sortby parameter, as I’ve mentioned in the above post. Alternatively, is there a better, more user-friendly way to solve this problem (i.e the end-user being able to choose the order that ditto is displaying each ’block’)?
            • 11975
            • 2,542 Posts
            Hi,

            which version of ditto are you using ? (1.0.2, 1.1.2, 2.0)

            :-)
              Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
              • 16311
              • 28 Posts
              Sorry I should have mentioned that, it’s 1.0.2
                • 11975
                • 2,542 Posts
                I would recommend you to upgrade to the latest 2.0 which is much more powerful.

                Note that I guess &sortDir is set by default to DESC.


                :-)
                  Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
                  • 16311
                  • 28 Posts
                  Thanks for the advice, I’ve upgraded to version 2.0 RC2 and suddenly it’s working perfectly.