One dynamic page with different a different collection for each sub pages, and a unique filter of that collection for each sub page

Question:
Does anyone know how to create one dynamic page with one collection, but with a different collection for each of its item pages and a unique filter of that collection on each page? (see my scenario below to understand this better)

Thank you!

Product:
Wix Studio Editor

What are you trying to achieve:

The next hypothetical scenario:

  • I have a page with a list of fruits “My fruits”.
  • The list of fruits is based on a Collection that includes all of my fruits.
  • Once I click a fruit, I’m moving to a new page, called “Fruit page”
  • “Fruit page” includes a list, that contains a variation of the selected fruit, “Fruit variations list”
  • This list, is based on a different single collection that includes variations of all fruits. However, the selected “Fruit page” includes only the variations that are relevant to it.
  • If I click another fruit, I’ll move on to a page with a list that contains variations that are related to that specific fruit as well.
  • Some variation items from the “Fruit variations list” can appear on parallel in different fruit pages
  • Each variation has its own page as well “Variation page”.

Ideally, I want to have only 3 pages to manage, “My fruits”, “Fruit page”, “Variation page”

This is the structure I need but I can’t find a way to do that.
It is very difficult to manage the design of these pages as I have many of them and each can contain a list with various filters.

What have you already tried:
I’ve tried using a dynamic page but it seems like I can’t have a unique filter for each variation of the dynamic page. Also trying using a Category in the slug, wasn’t able to make it work

You’ll need 2 databases for this to work.

Keep your current setup with dynamic pages connected to the collection with your fruits.

Create a second database called “Variations” with your variations. You’ll also need a reference field on each item that references the Fruits database.

What this does is each variation item will reference it’s main fruit.

Then on the list page, add a repeater, create a new dataset connected to the “Variations” (you should have 2 datasets) and connect it to the repeater.

Then on the new dataset, setup a filter so that the reference field matches the current item.

Hope this helps :slight_smile:

1 Like

Hey @noahlovell,
thanks so much - we are making progress!

I’ve tried using your method and it’s almost there.
It works well with one field - however, I need more references.
Each variation of fruit can be linked to multiple fruits on the Fruits database.

When I set multiple filters it behaves as “AND”, but I need the option to add multiple filters and set them perhaps as “OR”. Is that possible?

Much appreciated!

@noahlovell I just realized that there is the multiple-reference field. It works like a charm so far! much appreciated, that’s life-changing.

If I may, I have another important question to complete the picture.
I also have an embedded html element in the selected fruit page, next to the list (that is now filtered). This embedded HTML (stores a map), is different for each fruit. is there also an option to control this without code?

Thank a lot again,
Royi