Displaying a media gallery on one specific page

Question:
How do I get my media gallery data field to appear in the editor and on the live site?

Product:
Wix Studio Editor

What are you trying to achieve:
I am trying to add a media gallery to one of my pages. I have a dynamic page set up.

What have you already tried:
I have added the media gallery data field and added all the pictures I want to display, and saved it. The media gallery will not show despite saying it is in there.

Collapse the element by default, and have it expand according to the dynamic item you’re viewing

For example, say you had a boolean field tagged ‘showGallery’, you coud do:

const dataset = $w('#dynamicDataset')
dataset.onReady(() => {
    const item = dataset.getCurrentItem()
    if (item.showGallery) $w('#gallery').expand()
})

You could also check the actual gallery fiel to see if it has any contents, rather than create a boolean field for it

Thanks for the reply!

I’m still a little new to this. I am not using any code. I simply have the dynamic page set up, with a list of items and each item has its attributes.

Like I said though, it just won’t show up even though it says it’s there. Is there something that I’m not checking?

Have you added and linked a gallery element on the dynamic page?