Forum
collections filtering
I am trying to display items which belong to a collection and have been tagged with some categories.
So, i was thinking that this would work:
perch_collection('Products', [
'template' => 'product_detail.html',
'category' => perch_get('bracelets')),
]);
But sadly it doesen't. I believe the above works with perch_content_custom but it seems not to apply to perch_collection. What am I missing here? Any help would be appreciated
the second closing parenthesis at the end of line 3 is not the problem
Have you added debug to the page so you can see what is going on?
https://docs.grabaperch.com/docs/installing-perch/configuration/debug/
I am looking at the sql queries and I can't say what's going on. I tried to run them in Navicat and there are no errors but as it happens to my page, I get the full set of results not the subset.
Not sure if I should paste this here but maybe here is the problem
Is there a URL argument named
bracelets
that has a valid category path as its value?There is a page with the url: https://dropsjewellery/en/jewellery/bracelets
And there is a category with a path: kind/bracelets/
What does your route look like?
The route for the above page is: en/jewellery/bracelets/[slug:product_slug]
But I have tried the same from another page such as https://dropsjewellery/en/jewellery/earrings that has no route.
In debuging It looks like when I change the request to say "rings" instead of "bracelets" nothing different is happening
Ok, so you want something like
Nothing different is happening.
Your solution is what's needed. But what stopped it from working was a problem in my custom set/category template.
I shall make this question in another thread to display the issue.
Thanks,