Hi,
I'm trying to use getResources to list only those resources which are updated (editedon) after specific date.
I figured that i can use &where property.
[[!getResources? &parents=`0` &limit=`all` &where=`{*}` &tpl=`myRowTpl`]]
*resource editedon after specific date
Can anyone help with this?
Thnx.
-
☆ A M B ☆
- 24,524 Posts
The editedon field is a UNIX timestamp, so you would need to convert your control date to a timestamp. Where does it come from? If it's a TV or a placeholder, you could use the strtotime Output Modifier:
&where=`{editedon<[[*controldate:strtotime]]}`
It's specific date, so i used it's timestamp as control date. Although i didn't get the "greater than" working
&where=`{"editedon:>":1384241634}` < This isn't working
&where=`{"editedon:!=":1384241634}` < This is working
I know this isn't very cultivated solution. Maybe i just don't "get" the timestamp?
What about &where=`{"editedon:>=":1384241634}`?
-
☆ A M B ☆
- 339 Posts
Did you get it working? What was the solution?
Thanks David. Have to check these out.
I'm trying to use GetResources to display a random selection of only two of the four most recent posts. So any two of the most recent four posts. Using &limit=`2` works well to display purely the two most recent posts. Introducing RAND is fine to display all post randomly. So wanting to limit the RAND to only the most recent 4 posts. Tried using &where but failed. Any help appreciated.