WB
Web Bae12mo ago
niL

Pass query param to CMS filter search.

Hi. Just want to ask if it is possible to filter a search on the input field based on the name of an item? It works on the checkbox but I can't seem to make it work for the input field.
5 Replies
niL
niLOP12mo ago
Also tried to used query params from FS. It doesn't filter the input field when the query is passed. have to retype it to filter.
AtomicZBRA
AtomicZBRA12mo ago
I think it is possible because finsweet do it on their attributes directory page: https://finsweet.com/attributes?name=slider you see it filters by default based on the query params which i'm pretty sure is your desired outcome. Checking to see if they do any fancy js in there Actually it also works in their cloneable for the solution as well! Can you try structuring your search field like in the example? They're not using the query param solution at all -> https://preview.webflow.com/preview/cms-filter-example?utm_medium=preview_link&utm_source=showcase&utm_content=cms-filter-example&preview=0d7b38a57563a64c71f374394e217d6b Okay @niL I figured it out: 1. Instead of using 'name, category, answers' in the fs-cmsfilter-field on the search input, just use * which will target all elements 2. Remove the fs-queryparam from the input field as well now when you search you use the text search you'll get ?*input+goes+here, and it will respect your other category selectors as well
niL
niLOP12mo ago
thanks man! Works like a charm!
Web Bae
Web Bae12mo ago
thanks @AtomicZBRA !
Want results from more Discord servers?
Add your server