-
- 44 Posts
Hi all,
I’ve tried a few examples I’ve seen around the forums, but can’t seem to get this to work at all.
I want to pop in a where statement on getResources to show only items published in the last three days.
Before I got involved with the ’3 days ago’ thing I thought I’d at least grasp a simple where statement on a set date.
However it just seems to show all results.
(I was going to paste my latest attempt but the modx menus got in the way again and I ended up clicking and leaving the page - d’oh)
If you want to display the top X posts you could use something like:
http://forums.modx.com/thread/70794/top-5-read-documents
If I recall getResources can filter/sortby the views TV to display the "results" if desired.
-
- 31 Posts
The top X posts is not really the problem, figured that one out.
Making getResources to select only the resources from the last X days and THEN sorting them is my question.
-
- 31 Posts
Wicked! that does the job! it works!
Thanks a lot!
Not only the CMS rocks, so does the community.
Correct; it's not currently possible to reference TV fields in the where clause, or use comparison operators other than LIKE to filter them. But you can sort by date TV fields using the sortbyTV and sortbyTVType properties and limit the number of results.
-
- 147 Posts
Anyone want to suggest a way to return posts that are not from, say, the current year?
David Walker
Principal, Shorewalker DMS
Phone: 03 8899 7790
Mobile: 0407 133 020