We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36592
    • 970 Posts
    Quote from: Mark at Jan 20, 2008, 02:16 AM

    Ditto, which retrieves the data for Reflect, substitutes the createdon date when the pub_date value is 0. Thus, $resource[$i][$templatesDateSource] should contain the desired date if &dateSource is set to pub_date.
    You mean, when you want to sort by ’pub_date’ in Reflect, you have to specify &dittoSnippetParameters=`parents:2|sortBy:pub_date` and &dateSource=`pub_date` at the same time ?
      • 18397
      • 3,250 Posts
      That would be a bug. Reflect should pass the dateSource set in Reflect to the Ditto instance it creates. Please file a bug report for it using the link in my signature. In the meantime, setting the parameters as you describe should make things work.
        • 36592
        • 970 Posts
          • 9849
          • 74 Posts
          Ok, although this post is rather old, I want to warm it up again because I am suffering a problem related to Ditto and Reflect, especially in combination with pub_date.

          The Reflect call list all news as expected. Whenever there is no pub_date it refers to createdon. But when I click on an archive (no matter if year or month) the next page just shows "No documents found". But that only happens with archives which containing news have no pub_date. Archives with news that have a pub_date work.

          If I call the targetID (57) directly I get output but as expected it is not filtered by month, year or whatever.

          Does anyone have an idea?

          The Reflect call
          [!Reflect?  &targetID=`57` &id=`newsArchiv` &dateSource=`pub_date` &dateFormat=`%d.%m.%Y` &getDocuments=`1` &showItems=`0` &dittoSnippetParameters=`parents:14|sortBy:pub_date` !]


          Document ID 57 (Reflect’s targetID)
          [+year+][+month+][+day+]
          [!Ditto? &id=`newsArchiv` &extenders=`dateFilter` &dateSource=`pub_date` &parents=`14`!]
            • 36592
            • 970 Posts
            [+year+][+month+][+day+]
            [!Ditto? &id=`newsArchiv` &extenders=`dateFilter` &dateSource=`pub_date` &parents=`14`!]
            

            I think you need to add &sortBy=`pub_date` to your Ditto call on your landing page.

            And you have to add id parameter in your date placeholders like [+newsArchiv_year+].
              • 9849
              • 74 Posts
              Quote from: tkfm at Feb 06, 2009, 09:25 AM

              I think you need to add &sortBy=`pub_date`…

              That did It. Thank you very much! Unfortunately [+newsArchiv_year+] od [+year+] does not work.
                • 29635
                • 361 Posts
                Wow I just spent way too long trying to figure out why Reflect wouldn’t take a pub_date for the dateSource. Thx for the sortBy tip.
                  Need MODx Ecommerce? Try FoxyCart!
                  • 36416
                  • 589 Posts
                  Quote from: The at Feb 19, 2009, 07:35 PM

                  Wow I just spent way too long trying to figure out why Reflect wouldn’t take a pub_date for the dateSource. Thx for the sortBy tip.

                  Yep, I’d expect "orderBy" to work in place of "sortBy" parameter, too... bug?