Omit collection items in search
- Juan
- Thread is marked as Resolved.
-
-
-
Mxkert is probably the easiest option. However, filtering inside the template may lead to some issues. If you need pagination, the number of results per page may be inconsistent (and some pages may not show any results). The other issue is you can't easily tell when you get no results.
An alternative would be to skip the templating, disable pagination and handle the rest in PHP:
You may find these blog posts relevant:
-
I didn't realize that I could use perch_template() to output the search without the unwanted items. I'll give it a try.
I also tried getting all the _id's that matched the search and then filter by those values when calling perch_collection(). The problem is that I only got the first match. This was the code:
-
-