MODX Revolution MIGX filter TV by date

795 Views Asked by At

I'm using MODX Revolution MIGX for a variety of TVs that are displayed in a table via getImageList. I need to filter the results by a date TV to all future dates.

Anyone knows?

Thanks for help.

1

There are 1 best solutions below

0
On BEST ANSWER

You need to add a &where clause to your MIGX call and use a snippet to get today's date in a suitable format.

<?php
/*
* Today's date snippet, save as TodaysDate
*/
return date('Y-m-d H:i:s');

Example where clause:

[[getImageList?
    &tvname=`my_tv`
    &tpl=`my_tpl`
    &where=`{"my_date:<=":"[[TodaysDate]]"}`
]]