Answer the question
In order to leave comments, you need to log in
[[+content_image]]
How to filter by date in modx?
The document is inferred via PdoPage
[[!pdoPage?
&tpl=`tplServer`
&parents=`7`
&pageLimit=`5`
&limit=`30`
&includeTVs=`adress,date,hron,reit,sort`
&tvFilters=`date==%[[!today]]%`
&showLog=`1`
]]
[[!+page.nav]]
<tr>
<td><a href="[[+tv.adress]]" target="_blank">[[+pagetitle]]</a></td>
<td>[[+tv.reit]]</td>
<td></td>
<td>[[+tv.sort]]</td>
<td>[[+tv.hron]]</td>
</tr>
return date("Y m d");
Answer the question
In order to leave comments, you need to log in
There are several solutions:
1) Try it in &where=`{"date":"[[today?]]"
2) And how is the TV date filled in? Myself? Why not filter by [[+publishedon]] - resource publication date or [[+createdon]] - creation date?
Through "where" filters on TV do not work.
Try changing the code in the today snippet to: return date('Y-m-d H:i:s');
And also remove the border of the snippet %%
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question