Website Building » Wix » How Do I Create a Dynamic Page Filter in Wix?

How Do I Create a Dynamic Page Filter in Wix?

Last updated on January 3, 2023 @ 8:44 pm

A dynamic page filter is a powerful tool that can be used to filter pages on a Wix site. There are two ways to create a dynamic page filter: using the Wix Editor or Wix Code.

The Wix Editor is the easiest way to create a dynamic page filter. To do this, simply create a new page and add the following code to it:

GREAT NEWS:

Exciting update! We've collaborated with Wix to offer WBI users with a free plan for all website creation needs - Explore the details here.

<!-- Start of Dynamic Page Filter code -->
  <script type="text/javascript">
    $(document).ready(function() {
    // Your code here });
  </script>
<!-- End of Dynamic Page Filter code -->

Replace “Your code here” with the following code:

document.getElementById('PAGE_NAME').value = 'FILTER_VALUE';

Where PAGE_NAME is the name of the page you want to filter and FILTER_VALUE is the value you want to filter by. For example, if you want to filter by page type, you would use the following code:

PRO TIP: If you are not careful, creating a dynamic page filter in Wix can result in some serious problems. First, it is important to understand that a dynamic page filter can only be used on pages that are based on a single data collection. If you try to use it on pages that are based on multiple data collections, you will almost certainly run into problems. Second, you need to be very careful about the rules that you set up for your filter. If you are not careful, you can easily end up with a filter that does not work the way you want it to. Finally, remember that a dynamic page filter is not a substitute for a good search engine optimization strategy. If you want your pages to be found by people who are looking for them, you need to make sure that they are properly optimized for the search engines.

document.getElementById('pageType').value = 'blog';

This will show only pages that have been tagged with the “blog” page type. You can also use multiple values, separated by commas, to show multiple types of pages. For example:

document.value = 'blog,product';

Morgan Bash

Morgan Bash

Technology enthusiast and Co-Founder of Women Coders SF.