top of page

Advanced features

CMS

CMS: Adding a Dataset Filter to Display Content from Multiple Collections


Using a dataset filter in the CMS (Content Management System) allows you to display content from multiple collections on a single page. This can be particularly useful if you want to show related items from different collections together, offering a richer experience for your site visitors. For example, if you have a blog collection and an author collection, you can use a dataset filter to display blog posts along with author details on the same page.


Before you begin, make sure to set up the following:


You need at least two CMS collections:


  • Primary collection: Connect this collection to elements on the page where you want to display content from both collections. This can be a static or dynamic page.

  • Secondary collection: This collection includes info that relates to the items in your primary collection. Make sure your secondary collection has a field that matches the values of a field in your primary collection exactly.



Adding a dataset filter to display content from multiple collections


After adding the dataset filter, you need to connect elements on your page to the secondary collection's dataset to display the filtered content.


Wix Editor


  1. Go to your editor.

  2. Go to the page where you want to show content from both collections. Your primary collection should already be connected to a dataset that connects to the page elements.

  3. Add a dataset and connect it to your secondary collection:

    1. Click CMS

      CMS: Adding a Dataset Filter to Display Content from Multiple Collections

      on the left.

    2. Click Manage Page Connections.

    3. Click Add a Dataset in the panel on the right.

    4. Click the Choose a collection drop-down and select your secondary collection.

    5. (Optional) Edit the name of the dataset.

    6. Click Create.


Screenshot of adding a dataset that connects to a secondary collection.

  1. Add a filter to your secondary collection's dataset:

    1. Click the More Actions icon

      CMS: Adding a Dataset Filter to Display Content from Multiple Collections

      next to your secondary collection's dataset in the panel on the right.

    2. Select Dataset Settings.

    3. Click + Add Filter.

    4. Click the Field drop-down and select the field that has the same values as a field in your primary collection.

    5. (Optional) Click the Condition field to change the operator that determines how the filter is applied. For example, when set to Is, the secondary collection's dataset only retrieves values from the primary collection if the field used in the filter has the same value in both collections.

    6. Select Another dataset under Value source.

    7. Click the Dataset drop-down and select the dataset that connects to your primary collection.

    8. Click the next Field drop-down and select the field from your primary collection that matches the secondary collection field. The fields that contain the matching values should be selected in each of the Field drop-downs on this filter.

    9. Click Add Filter.


Screenshot of adding a dataset filter in the Wix Editor.

  1. Connect elements to the secondary collection's dataset to show content from the collection:

    1. Click the relevant element (e.g. text, image) and select the Connect to CMS icon

      CMS: Adding a Dataset Filter to Display Content from Multiple Collections

      .

    2. Click the Choose a dataset drop-down and select your secondary collection's dataset.

      Note: Don't worry if any of the CMS connections in your editor appear to disconnect at this point. Once you're done with the connections, you can click Preview to test the new connections.

    3. Click the relevant drop-down(s) under Connections and select the secondary collection's field(s) that you want to connect.


Screenshot of connecting a text element to the secondary collection dataset.

  1. Click Preview to test your connections.

  2. Publish your site when you are ready to make the changes go live.


Studio Editor


  1. Go to your editor.

  2. Go to the page where you want to show content from both collections. Your primary collection should already be connected to a dataset that connects to the page elements.

  3. Add a dataset and connect it to your secondary collection:

    1. Click CMS

      CMS: Adding a Dataset Filter to Display Content from Multiple Collections

      on the left.

    2. Click Manage Page Connections.

    3. Click Add a Dataset in the panel on the right.

    4. Click the Choose a collection drop-down and select your secondary collection.

    5. (Optional) Edit the name of the dataset.

    6. Click Create.


Screenshot of adding a dataset that connects to a secondary collection.

  1. Add a filter to your secondary collection's dataset:

    1. Click the More Actions icon

      CMS: Adding a Dataset Filter to Display Content from Multiple Collections

      next to your secondary collection's dataset in the panel on the right.

    2. Select Dataset settings.

    3. Click + Add Filter.

    4. Click the Field drop-down and select the field that has the same values as a field in your primary collection.

    5. (Optional) Click the Condition field to change the operator that determines how the filter is applied. For example, when set to Is, the secondary collection's dataset only retrieves values from the primary collection if the field used in the filter has the same value in both collections.

    6. Select Another dataset under Value source.

    7. Click the Dataset drop-down and select the dataset that connects to your primary collection.

    8. Click the next Field drop-down and select the field from your primary collection that matches the secondary collection field. The fields that contain the matching values should be selected in each of the Field drop-downs on this filter.

    9. Click Add Filter.


Screenshot of adding a dataset filter in the Studio Editor.

  1. Connect elements to the secondary collection's dataset to show content from the collection:

    1. Click the relevant element (e.g. text, image) and select the Connect to CMS icon

      CMS: Adding a Dataset Filter to Display Content from Multiple Collections

      .

    2. Click the Choose a dataset drop-down and select your secondary collection's dataset.

    3. Click the relevant drop-down(s) under Connections and select the secondary collection's field(s) that you want to connect.

      Note: Don't worry if any of the CMS connections in your editor appear to disconnect at this point. Once you're done with the connections, you can click Preview to test the new connections.


Screenshot of connecting a text element to the secondary collection dataset.

  1. Click the Preview icon

    CMS: Adding a Dataset Filter to Display Content from Multiple Collections

    at the top right to test your connections.

  2. Publish your site when you are ready to make the changes go live.



FAQs


Click below for answers to common questions about filtering by another dataset.


Select a field in your secondary collection that has values matching a field in your primary collection. This ensures the filter can correctly match and display related content.


Yes, you can add multiple filters to refine the content displayed from your collections further. Just repeat the steps to add a filter for each additional condition.


Yes, you can add multiple datasets and filters to display content from more than two collections, as long as the fields you use for matching have corresponding values.


The content will not be displayed from your secondary collection if the values between the collections do not match. Ensure that the fields in your primary and secondary collections have matching values. If they don't, you may need to update the data in your collections to ensure they align correctly.


Yes, you can edit the name of the dataset during or after creation to keep your datasets organized and easily identifiable.


Double-check the fields and values used in your filters to ensure they match correctly. Also, preview your site to test the connections and make any necessary adjustments.


Need A Professional Website?
Contact Us 
Today!

I'm a paragraph. I'm connected 

I'm a paragraph. I'm connected 

I'm a paragraph. I'm connected 

I'm a paragraph. I'm connected 

I'm a paragraph. I'm connected 

I'm a paragraph. I'm connected 

wix experts
Graphic2Traffic web design
©
bottom of page