We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19388
    • 297 Posts
    Hello,
    I has a content tree and I want to display the 10 first items with pub_date after now. The way I found was using the ditto "where" parameter but instead of giving me the results with pub_date bigger than the actual unix timestamp, it shows me all the elements. It appears to be ignoring the where clause.

    [!Ditto? &parents=`6` &depth=`0` &orderBy=`pub_date ASC` &tpl=`eventos_pd` &display=`10` &showPublishedOnly=`0` &phx=`1` &where=`pub_date >= UNIX_TIMESTAMP()` &debug=`1` !]


    Using the Ditto debug, I can see in parameters that my "where" appears to be incomplete, as it does not show the >=UNIX_TIMESTAMP()
    where  	pub_date 


    I executed this where clause in mysql directly and it works. Is Ditto ignoring my where sentence?

    I use MODx 0.9.6.3 with PHx ( Ditto pagination working )
      • 19388
      • 297 Posts
      I finally solved that using "filter":
      [!Ditto? &parents=`6` &depth=`0` &orderBy=`pub_date ASC` &tpl=`eventos_pd` &display=`10` &showPublishedOnly=`0` &phx=`1` &filter=`pub_date,@EVAL return mktime()-86400;,6` &hideFolders=`1` !]

      But I continue wants to know why "where" was not working, if anybody knows...