We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28033
    • 925 Posts
    http://ditto.modxcms.com/tutorials/sort-by-a-date-tv.html

    Basically, if I sort by %b, will that show all of the news in that month, if I insert in Jul, for instance, in the TV value?
      My Snippets
      -> PopUpChunk v1.0
      • 7231
      • 4,205 Posts
      More or less correct. That is the way to sort by a date TV, but you can use any of the default document dates (publish, edited, created) to sort.

      I think that the dateFormat is only used for displaying the +date+ placeholder and has no effect on the sorting (I could be wrong).

      To show only the news in one particular month use the filter and filter by month. You could also use reflect that will output an archive configurable by month or year.
        [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]
        • 28033
        • 925 Posts
        [[Ditto?parents=`1688,1722,1761,1690,1716,1732,1728,1698,1758,1699,1711,1707,1772` &display=`all` &tpl=`ditto-news` &dateFormat=`%b %d, %Y @ %I:%m %p` &extenders=`dateFilter` &dateSource=`createdon` &month=`3` &year=`2008`]]


        Shouldn’t this sort by the month of March? Because it’s not working correctly on my site (it’s showing news outside of March)...
          My Snippets
          -> PopUpChunk v1.0
          • 36592
          • 970 Posts
          Try using uncached form ( [!...!] ) for your Ditto call.
            • 28033
            • 925 Posts
            Quote from: tkfm at Jul 31, 2008, 08:05 PM

            Try using uncached form ( [!...!] ) for your Ditto call.

            All that does is read the templates for Ditto literally (showing the snippet calls instead of parsing them).
              My Snippets
              -> PopUpChunk v1.0
              • 36592
              • 970 Posts
              Where did you placed your Ditto call ?
              In the template chunk of another Ditto call ?
                • 28033
                • 925 Posts
                Quote from: tkfm at Jul 31, 2008, 09:51 PM

                Where did you placed your Ditto call ?
                In the template chunk of another Ditto call ?

                I have Jot and DateTime called in my Ditto template.

                And this Ditto call I posted earlier was in a document, for March 2008.
                  My Snippets
                  -> PopUpChunk v1.0
                  • 36592
                  • 970 Posts
                  Quote from: Soshite

                  All that does is read the templates for Ditto literally (showing the snippet calls instead of parsing them).
                  I have Jot and DateTime called in my Ditto template.
                  Then, uncached form for Ditto and cached form for Jot and DateTime snippet call in the Ditto template would work.
                    • 28033
                    • 925 Posts
                    Quote from: tkfm at Jul 31, 2008, 11:02 PM

                    Quote from: Soshite

                    All that does is read the templates for Ditto literally (showing the snippet calls instead of parsing them).
                    I have Jot and DateTime called in my Ditto template.
                    Then, uncached form for Ditto and cached form for Jot and DateTime snippet call in the Ditto template would work.

                    I’ll try it, but it doesn’t make sense why calling it uncached would do anything (wouldn’t I already see it fixed by doing that, which it didn’t do)?

                    EDIT: Like I thought, doing that does nothing. I think I have the syntax wrong somehow...
                      My Snippets
                      -> PopUpChunk v1.0
                      • 28033
                      • 925 Posts
                      I resorted to using Reflect, and styling the archive month list how I needed it. wink
                        My Snippets
                        -> PopUpChunk v1.0