I have a repeater that links to a collection of products (not the store). I want to be able to click on each individual image in the repeater and have it link to the respective dynamic page (the dynamic page cycles through products). Right now, every image in the repeater is linking to the same product in the dynamic page. How do I fix this? #dynamicpage#collections#databasecode#productpage#links
UPDATE: This was solved with the editor using a link to dynamic page function.
Can you share more information or a URL to the page? It is hard to debug a problem when there are so many variables to consider.
For example, are you using data binding on the repeater? How are you capturing the repeater image clicks? If you share the page and the code you’ll get a more informed answer.
One of the normal problems that happens with capturing events on repeaters is that new coders don’t understand the notion of repeater scope. If you have a click handler that was created for you by the editor property panel then you will need to make sure you convert the event argument into a scope function so that you can manage the event from the correct repeater element.
You do this using the $w.at() function. When the event handler fires you grab the event argument which contains a repeater context → event.context.
This is given to the global Wix scope function at helper function to get the repeater element scope
→ let $repeaterScope = $w.at(event.context);
Now you can use the element ID for the clicked item to get the dynamic page information you are looking for:
→ let clickedElementValue = $repeaterScope(‘#clickedElement’).value;