We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33982 ☆ A M B ☆
    • 476 Posts
    Question: I’m trying to figure out what value I need for a parameter on Ditto to make documents list in Alphabetical order. For example, I’ve built a site that people are posting audio files on. They are entering the audio files in no particular order and unfortunately I can’t figure out how to list the documents being added to list by their name. For example, they are formating the document’s name by date:

    • 07.2.21 Audio File Name
    • 07.2.15 Audio File Name
    • 06.3.24 Audio File Name
    and so on...

    I want the most recent date to be at the top and for the order to go down accordingly. Currently it is listing by when the documents were created. Here’s the page where I’m having a problem getting the documents to list correctly:

    http://coastallifesd.com/our-messages.html

    Here’s my Ditto call: [!Ditto? &startID=`40` &alwaysshow=`1` &sortDir=`ASC` &tpl=`Sermons` &tagData=`tvSermons` &summarize=`40`!]

    I looked through the documentation and couldn’t not find the info I needed. Anyone know how to fix this?

    Thanks!
      Precision Web Development ... SmashStack.com
      • 18397
      • 3,250 Posts
      1. What version of Ditto are you using?

      2. &alwaysshow=`1` and &tagData=`tvSermons` should not be in your call... AlwaysShow is for always showing pagination previous and next links and tagData is for use with tagging...

      3. The easiest way to handle this would be to create a date TV and give it the unixtime widget. Then append &sortBy with it equal to the name of the tv you created (include the prefix tv if you are using a Ditto version before 2).

      4. If you are familiar with PHP you can write a simple snippet to get the first x characters of the document title and then use the strtotime function to convert it to unixtime value which Ditto can sort by...
        • 33982 ☆ A M B ☆
        • 476 Posts
        Thanks Mark for the insight...I’ll make the changes as you advised. I’m also using the latest version of Ditto 1.0.2

        I really appreciate your taking the time to help with things like this. I’ll give it a try and reply with the response.
          Precision Web Development ... SmashStack.com
          • 33982 ☆ A M B ☆
          • 476 Posts
          Hello Mark,

          I actually figured out a much easier way...here’s the new Ditto call:

          [!Ditto? &startID=`40` &tpl=`Sermons` &sortBy=`pub_date` &sortDir=`DESC` &summarize=`40`!]

          Under the "Page Settings" tab, click on "Publish Date" and specify when the document was published. In this case, I’ve got a church that is uploading sermons and I wanted them to be able to upload them in no particular order but yet set them in order.

          Thanks for your willingness to answer my questions! I appreciate it!
            Precision Web Development ... SmashStack.com
            • 34162
            • 1 Posts
            hi i’ve also got this trouble and i don’t know if i can change my ditto or the page itself. i kinda see what you mean with the publish date but how does that make them alphabetically sorted?

            anyway i’ve got this on the page:

            [[Ditto? &startID=`73` &summarize=`73` &removeChunk=`Comments` &tpl=`ditto_blog2` &paginate=`1` &extenders=`summary,dateFilter` &paginateAlwaysShowLinks=`1` &tagData=`documentTags`]]

            Showing [+start+] - [+stop+] of [+total+] Articles
            [+previous+] [+pages+] [+next+]
            [[Reflect? &dittoSnippetParameters=`startID:2` &groupByYears=`0` &showItems=0` &tplMonth=`reflect_month_tpl`]]

            so can i make that reflect alphabetic list rather than the date created?

            also i have this code for the ditto:

            <div class="ditto_summaryPost">
            <h3><a href="[~[+id+]~]" title="[+title+]">[+title+]</a></h3>
            <div class="ditto_tags">Tags: [+tagLinks+]</div>
            [+summary+]
            <p class="ditto_link">[+link+]</p>
            </div>

            thanks for any help...
              • 7231
              • 4,205 Posts
              You need to add a sortBy parameter, to get it alphabetical simply select the correct field (ex: pagetitle) and then set: &sortBy=`pagetitle` and define the order by either ASC or DESC: &sortDir=`ASC`.

              [[Ditto? &startID=`73` &summarize=`73` &removeChunk=`Comments` &tpl=`ditto_blog2` &paginate=`1` &extenders=`summary,dateFilter` &paginateAlwaysShowLinks=`1` &tagData=`documentTags` &sortBy=`pagetitle` &sortDir=`ASC`]]
                [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&#39;t know what it is.
                Do you, Mr. Jones? - [bob dylan]
                • 34162
                • 1 Posts
                thanks that is great! works perfect, thanks so much for your help! brilliant!