Forum
Filtering multiple titles from a collection
Hi,
I am using Perch Runway and would like to display 6 items from this collection. I am trying to filter by title, but I can't get it to work.
I have tried this:
perch_collection('Standpunt Pagina', [
'template' => 'standpunten/standpunt_carousel.html',
'filter' => 'titel',
'match' => 'in',
'value' => 'Immigratie', 'Veiligheid', 'Huisvesting en wonen', 'Jongeren', 'Openbaar vervoer', 'Westlandse cultuur'
]);
Am I separating the values wrong, or using the wrong match?
Mike
Probably:
That is also not working. I also tried array(['Immigratie', 'Veiligheid', 'Huisvesting en wonen', 'Jongeren', 'Openbaar vervoer', 'Westlandse cultuur']) which is also not working.
The value needs to be a comma-separated string.
Have you tried looking at the debug to see what the database query looks like? Does it work if you filter for just one title?
Debug says the following:
It does work with only one title.
That query looks as if it's returning one item - is it
'Immigratie'
?If so the string you need is probably:
(removing the leading spaces from each item in the list).
Yes, it is working! Thank you very much Duncan