Hey Mark,
Have recently used Ditto to create an ’upcoming events’ listing system for a centre, and this has all gone down very well indeed. Initially my plan was for them to either use unpublish dates or delete documents after the event had finished, however they have asked if it is possible to have the events auto-archived after they event had started.
This to me seems like it should be easy enough using the filtering options available in Ditto and either two ditto calls (one on upcoming events and other in past events) or a Ditto and a Reflect, either way.
Using this call
[!Ditto?&debug=`1`&filter=`SortingDate, '@EVAL return time()',3`&extenders=`dateFilter`&sortDir=`ASC` &parents=`[*id*]` &summarize=`10` &tpl=`EventEven`&tplAlt=`EventOdd`&sortBy=`SortingDate` &paginate=`1` &alwaysshow=`1` &tplLast=`EventOdd`!]
I receive all my documents, including the test one on the past. Changing filter mode to 4 i get no documents at all. Have tried both cached and uncached with the same results.
Have tried using <?php ?> to wrap the time request, using @EVAL as you see and @CODE, also just leaving it as return time()/ time() by itself, so i am wondering if this functionality is actually built into the ditto filtering system, if so what am i doing wrong? I have read through the available documentation at the ditto subdomain and the wiki but i can’t tell if this is going to work from what is currently documented about filtering.
If this is not possible i know i could setup a tv with the time call inside, lock it so that people dont play with it and just call it current time, but is it possible to then filter by comparing those two tv’s? ie. if SortingDate>CurrentTime then display.
The versions i am using are the latest SVN (2 revisions after Ditto 2.0) and Modx0.9.5
Appreciate that you are busy and sorry if this is a simple issue with a fix i have overlooked somewhere,
Thanks