my second filter id was part of a perch repeater list (as multiple voltages can apply) - I removed the repeater and the filter now filters everything correctly!
Two questions (and I apologise profusely for being an idiot)
Can this not work with a content id inside a repeater (I thought it would) and is there any way around it?
Is there a way of showing a message if non of the filters match (there are a few cases where combinations of types and voltages don't have a product associated).
Many many many thanks for your help, it's been invaluable
You can't filter based on the contents of a repeater. Well, you can, but you're filtering items, not repeater items. So you can filter items based on something that appears in that item's repeater. Use repeater_id.field_id.
You can use a <perch:noresults> section for displaying a message when there are no results.
Ok, that looks fine.
I'm not quite following what the error is, to be honest.
Ok, I'll try and explain the error as simply as possible.
Theres two products I've entered.
Product one is Type 1 (filtered by the first select) and Voltage 2 (filtered by the second select)
Product two is Type 1 (filtered by the first select) and Voltage 1 (filtered by the second select)
When type 1 is selected in the first select and voltage 2 selected in the second select both products are still appearing.
The second filter doesn't seem to filtering the results down further.
Are you using AND or OR?
am using OR at the moment, when using AND I get no results
Right, I've cracked the issue...
my second filter id was part of a perch repeater list (as multiple voltages can apply) - I removed the repeater and the filter now filters everything correctly!
Two questions (and I apologise profusely for being an idiot)
Can this not work with a content id inside a repeater (I thought it would) and is there any way around it?
Is there a way of showing a message if non of the filters match (there are a few cases where combinations of types and voltages don't have a product associated).
Many many many thanks for your help, it's been invaluable
Nik
You can't filter based on the contents of a repeater. Well, you can, but you're filtering items, not repeater items. So you can filter items based on something that appears in that item's repeater. Use
repeater_id.field_id
.You can use a
<perch:noresults>
section for displaying a message when there are no results.Nailed it Drew, all filtering correctly now with both filters.
Adding the repeater.field into my code has opened up all the filtering I needed... last piece of the jigsaw.
Thanks so much for putting up with me and my relentless questions. Think I've tested your tutorial almost to destruction!
Cheers
No problem!