We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28563
    • 35 Posts
    $sortBy = isset($sortBy) ? $ditto->checkSort($sortBy, $dateFormatType, $mode) : "createdon";
    // get sortBy

    What options can I sort by? What does mode mean?
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      I think "mode" is ASC or DESC. Ditto presumes you will be sorting by a date value, createdon, editedon, or publish dates. I have forced it to sort by other values, specifically menu index, and it seemed to work OK.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 2136
        • 134 Posts
        my testing has been inconclusive.

        i’m trying two TVs:
        1) a multi-select listbox with the options ’brand||print||web’ using the delimited list widget and a comma as delimiter
        2) a text input with no option values also using the delimited list widget and a comma as delimiter

        there are 3 articles:
        article A - tagged with only ’print’
        article B - tagged with ’web,brand’
        article C - tagged with ’brand,web,print’ (switched brand & web to test the calls)

        my 2 calls, both on the same page:
        [!Ditto? &startID=`12` &tpl=`blogTemplate` &summarize=`10` &filter=`tvworkTags,web,6` &tagDelimiter=`,` !]

        [!Ditto? &startID=`12` &tpl=`blogTemplate` &summarize=`10` &filter=`tvworkTags2,web,6` &tagDelimiter=`,` !]


        i changed the number after ’web,’, trying 1 through 6 and looking for something that will produce only the 2 articles with the ’web’ tag. the test results, separated by call & showing whether article A, B or C was a result:

        #1: no entries returned
        Call 1= none
        Call 2= none

        #2: all entries returned, even without the ’web’ tag
        Call 1= ABC
        Call 2= ABC

        3: call 2 returned the entry that had the ’web’ tag first
        Call 1= none
        Call 2= B

        4: one call returned all entries, the other ignored the one with the ’web’ tag first
        Call 1= ABC
        Call 2= AC

        5: one call returned all entries, the other ignored the one with the ’web’ tag first
        Call 1= ABC
        Call 2= AC

        6: call 2 returned the entry that had the ’web’ tag first
        Call 1= none
        Call 2= B

        so from my testing, it did not once do what i want it to do - show all entries with the ’web’ tag, regardless if that is the first tag or not. either A) it can’t do this, which totally makes no sense as it practically makes the tagging feature useless, or B) i don’t know how to setup the TV properly (no surprise there).

        Bueller?
          Sorry - not using ModX anymore 01/01/2007
          • 25663 MODX Staff
          • 12,272 Posts
          I suspect A due to a bug in the logic.
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 2136
            • 134 Posts
            Better than B, which might require deleting the user tongue

            a possible workaround would be 3 TVs, one for each tag then...
              Sorry - not using ModX anymore 01/01/2007
              • 2136
              • 134 Posts
              how does one make the actual entry display the title?
                Sorry - not using ModX anymore 01/01/2007
                • 18397
                • 3,250 Posts
                @arphaus: Can you append &debug=`1` to your call and then paste your output here (in code tags or a file please; not plain text!) so I can get an inside look as to what is happening?
                  • 2136
                  • 134 Posts
                  sorry, i switched to 3 separate TVs for each tag & removed the other TVs. i’ll try it again and post results if i get a chance.
                    Sorry - not using ModX anymore 01/01/2007
                    • 32982
                    • 674 Posts
                    how to show the archive?
                    y put in the template a [+archive+] placeholder
                    and call ditto

                    $displayArchive = isset($displayArchive)? $displayArchive : 1;
                    $archivePlaceholder = isset($archivePlaceholder)? $archivePlaceholder : 1;
                    but nothing show in the archives (oldest dont show)
                      Jabiertxof (formerly XYZVISUAL)
                      My bussines: http://marker.es
                      https://www.youtube.com/user/jabiertxof/videos
                      • 2136
                      • 134 Posts
                      i looked through all the files involved with the snippet (..class.inc... & ...english.inc..., as well as the snippet itself) for a couple more things i’d like to do. i managed to get it to truncate at the splitter, which was easy enough, but how does one sort the summaries alphabetically? is there any actual documentation for Ditto, beyond http://modxcms.com/ditto_documentation.html?
                        Sorry - not using ModX anymore 01/01/2007

                      This discussion is closed to further replies. Keep calm and carry on.