
<table cellspacing=0 cellpaddling=10 border=1>
[[getImageList?&tvname=`prices`&tpl=`pricesTpl`&where=`{"[[+num]]" lt "10"}`]]
</table>
This question has been answered by Bruno17. See the first response.
tryThanks, now it works! But what do all these colons mean?&where=`{"num:<":"10"}`
this is a json-style array (key/value - pairs)Thanks, nice! Looks like the condition I need could be written in this way, too? --
http://www.json.org/
the key is delimted by ':'
first part - the fieldname
second part - the operator
possible operators, see:
https://github.com/Bruno17/MIGX/blob/master/core/components/migx/model/migx/migx.class.php#L1966
the value is the value, you are searching for.
the syntax is nearly the same as in getResources or many other snippets where-property
&where=`{"num:lt":"10"}`
this should work:Yeah, it's magic, it works! Thank you very much!
&where=`{"num:>=":"10","num:<":"20"}`
[tags] => Category 1, Category 2, Category 3
http://www.site.com/gallery/?tags=Category+1
[[getImageList? &tvname=`gallery` &tpl=`gallery-tpl` &where=`[[!FilterTags]]`]]
$output = '';
if(isset($_GET['tags'])) {
$tag = $_GET['tags'];
$output = '{"tags:LIKE":"%'.$tag.'%"}';
}
return $output;
Is there any way this works with having multiple categories on each items?
Example i have categories "Category 1, Category 2, Category 3, Category 4, Category 5"
Now on my MIGX items, i can tag each item with categories above (i.e. Category 1, Catgory 2) using multilist tv with output separator with comma (,).
So let say on item 1, i have selected 3 categories on tv named [tags] so the value would be[tags] => Category 1, Category 2, Category 3
Let say i would like to filter my MIGX items with tags, on my URL it will behttp://www.site.com/gallery/?tags=Category+1
and my MIGX snippet is[[getImageList? &tvname=`gallery` &tpl=`gallery-tpl` &where=`[[!FilterTags]]`]]
Here's my FilterTags snippet;
$output = ''; if(isset($_GET['tags'])) { $tag = $_GET['tags']; $output = '{"tags:LIKE":"%'.$tag.'%"}'; } return $output;
but this doesn't seem to work. Any idea why? or what did i miss? Thanks