Description
I’m using the CMS filter and it’s awesome!!! I’m wondering if it’s possible to filter a list thru category and tag. For example, if I click “Museum” in the filter list or if I click “Museum” under my list item, I only want to see “Museum” posts.
Is this possible?
Site URL
Required: Please provide a staging/production URL where we can see the issue
Hey @ritughiya!
Sure, you can make the tag filter the list by using Mirror Click Event.
- Add the Mirror Click script tag in your page script :
<script async type="module"
src="https://cdn.jsdelivr.net/npm/@finsweet/attributes@2/attributes.js"
fs-list
fs-mirrorclick
></script>
- On each tag inside your list item (trigger), add:
<a
fs-mirrorclick-element="trigger"
fs-mirrorclick-instance="{{Name}}"
fs-list-field="tag"
fs-list-value="museum"
>
Museum
</a>
- On the matching filter radio (target), add:
<input
type="radio"
fs-list-field="tag"
fs-list-value="museum"
fs-mirrorclick-element="target"
fs-mirrorclick-instance="{{Name}}"
/>
Make sure both {{Name}} values reference the same property (e.g., category name or slug) so that the trigger and target are connected correctly.
Let me know if you need any help!