I have a collection with 3 fields, each with 1 image.
I want to link a gallery on a dynamic page to the collection images.
I’ve tried placing the code that Yoav gave as an example here
My attempt is:
export function dynamicDataset_onReady() {
let item = $w('#dynamicDataset').getCurrentItem();
$w('#gallery1').items = [
{src: item.image1},
{src: item.image2},
{src: item.image3}
];
}
but nothing is happening in the preview page.
There are no console messages.
I think perhaps I’ve neglected an import statement, or maybe I’m placing the code altogether in a different page… right now it’s on the ‘page’ tab of the code editor in the dynamic page.
Any help would be appreciated.
Thank you.