<![CDATA[ [SOLVED] Filter with &where parameter : custom filter-snippets - MODX Community Forums]]> https://forums.modx.com/thread/?thread=80164 <![CDATA[Re: Filter with &where parameter]]> https://forums.modx.com/thread/80164/filter-with-where-parameter#dis-post-441785
I think these additions will offer me great possibilities.]]>
manonp Oct 30, 2012, 04:50 AM https://forums.modx.com/thread/80164/filter-with-where-parameter#dis-post-441785
<![CDATA[Re: Filter with &where parameter]]> https://forums.modx.com/thread/80164/filter-with-where-parameter#dis-post-441774 https://github.com/Bruno17/MIGX/commit/b07b69bb64ef3f2f6d378fdbaaffe4d334f1dd16

to core/components/migx/model/migx/migx.class.php

you can now have custom filter-snippets
and you can do it now this way:

[[!getImageList?
    &tvname=`showMultipleDates`
    &docid=`[[+id]]`
    &where=`{"dateShow:snippet:filtermonth":"09/2012"}`
]]


snippet 'filtermonth' :

$month = $modx->getOption('operand',$scriptProperties,'');
$date = $modx->getOption('subject',$scriptProperties,'');
$timestamp = strtotime($date);
$datemonth = strftime('%m/%Y',$timestamp);

return $datemonth == $month ? '1' : '';
]]>
Bruno17 Oct 30, 2012, 01:41 AM https://forums.modx.com/thread/80164/filter-with-where-parameter#dis-post-441774
<![CDATA[ [SOLVED] Filter with &where parameter : custom filter-snippets]]> https://forums.modx.com/thread/80164/filter-with-where-parameter#dis-post-441721
My MIGx elements are constructed in this way:
[{"MIGX_id": "1", "dateShow": "2012-10-09 12:30:00", "placeShow": "Theatre", "typeShow" "Programs"}, {"MIGX_id": "2 "," dateShow ":" 2012-10-10 12:30:00 "," placeShow ":" Theatre "," typeShow "" Programs "}]


I can see only one element if I know the exact date. For example the October 9, 2012:
[[!getImageList?
	&tvname=`showMultipleDates`
        &docid=`[[+id]]`
	&where=`{"dateShow:=":"2012-10-09 12:30:00"}`
]] 


I would like to extend this condition and display all the events of October 2012. How to write the condition &where?
Is it possible to use something like "regexp" ?

Thanks]]>
manonp Oct 29, 2012, 11:47 AM https://forums.modx.com/thread/80164/filter-with-where-parameter#dis-post-441721