Shadow
(Shane Richards)
November 6, 2016, 1:52am
1
How should i go about evaluating variables within a filter’s expression. My code:
hauslinienFilter = ${request.arguments.hauslinien}
regionFilter = ${request.arguments.region}
count = ${q(node).children(‘mosaicGridItems’).children(’[instanceof Country.Germany:MosaicGridItem]’).filter(’[hauslinien=hauslinienFilter]’).filter(’[region=regionFilter]’).count()}
Is there also a better way to pipe the conditional results?
mficzel
(Martin Ficzel)
November 6, 2016, 7:27am
2
You can combine multiple expression in a single filter like this:
.filter('[hauslinien=' + this.hauslinienFilter + '][region=' + this.regionFilter + ']')
If you want or-conditions add a comma between as described here. http://neos.readthedocs.io/en/stable/CreatingASite/TypoScript/EelFlowQuery.html#using-multiple-filters
Please note that you also have to use “this” to access sibling properties in fusion code or that you have to put the filters into the “@context ” to access them in the expression.
Regards, Martin
Shadow
(Shane Richards)
November 11, 2016, 11:09pm
3
Thanks for the help, got it working.