CMS filter | dynamic filter | save query


I’ve already read some of the questions in this forum, but i was wondering if i could get some support for the following questions:

  1. Is there a way to use dynamic visibility to show a filter (checkbox) only if that filter has results? (given other active filters) → this question was already asked here:
    Show only filters with results.

I couldnt find the correct solution for our site. Vind je perfecte auto | Bekijk ons ruime assortiment auto's

As an example, if i filter on this page, lets say, ‘make → ‘Kia’’, i want the filter ‘models’ to show me only the models available within Kia.

  1. Is there a way to save the site query’s, so if you go to a car-detail page and then go to the ‘previous page’ with the browser controls, you get back to the filtered site? If i do this now, the query is part of the URL, but the filter option isn’t selected.

Love to hear from you!


Problem 1 is fixed! If someone can help me with the second problem, it would be amazing.

Thank you for the update @Dennis_Unison!

I’ve been trying to debug the second issue to no success. This should be native behavior as navigating to the page using the same URL correctly sets the active filters…

I’ll open a bug report so this is addressed for V2.

Hi Luis,

Thanks for the response! I’ve also asked around within my network and the second issue was fixed by using the following lines of code within an external embed block:

type or paste code here
.w-checkbox:has(input:checked) .w-checkbox-input {
    border-color: var(--yellow-100);
    border-radius: var(--br-0-4-rem);
    background-color: var(--yellow-100);
    background-image: url( ;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 1.4rem;
    box-shadow: 1px 1px 3px transparent;


Maybe it will help you to debug this issue for the v2 version.

Best of luck and again, thank you for the reply :) 

1 Like

Here is how we’ve fixed problem 1


window.fsAttributes = window.fsAttributes || [];

// Initialize cmsnest
    (listInstances) => {
        console.log('cmsnest Successfully loaded!');

// Initialize cmsload
    (listInstances) => {
        console.log('cmsload Successfully loaded!');
            (filterInstances) => {
                const searchInput = document.querySelector('.filter_search-field');
                searchInput.dispatchEvent(new Event('input', { bubbles: true }));

                setTimeout(() => {
                    filterInstances.forEach((filterInstance) => {
                        const hideEmptyFilters = () => {
                            const resultsArray = filterInstance.filtersData.flatMap(filterData =>
                       => ({
                                    filterName: element.value,
                                    filterResults: element.resultsCount,

                            resultsArray.forEach(({ filterName, filterResults }) => {
                                const elements = Array.from(document.querySelectorAll('[fs-cmsfilter-field]')).filter(el =>
                                    el.textContent.trim() === filterName

                                elements.forEach(element => {
                                    const parentElement = element.parentElement.parentElement;

                                    // check if parent class name contains .w-dyn-item
                                    if (parentElement.className.includes('w-dyn-item')) {
                               = filterResults === 0 ? 'none' : 'block';

                        // Initial call to hideEmptyFilters

                        // Call hideEmptyFilters on rendering items
                        filterInstance.listInstance.on('renderitems', hideEmptyFilters);
                }, 1000);

1 Like

Thank you for sharing your solutions! I really appreciate it!

1 Like