Hi Guys,
This is my problem, I have an Estate agency website on the sales page there is a repeater with a short description of each property in each box with a button, then I have a dynamic page with all the information template connected to the property data set. I want to link the button via an on-click function with each properties id. I don’t know the code to go with the on-click function to each id URL.
Can anyone help please, thank you in advance and a merry Chrismas and a happy New Year
So you want to click on a button in a repeater to take you to a dynamic page link.
Well simply search the forum as that has been asked before…
https://www.wix.com/corvid/forum/community-discussion/link-to-dynamic-page-from-repeater-item-page
https://www.wix.com/corvid/forum/community-discussion/still-cant-find-option-to-link-repeater-to-dynamic-page
Also, have a read of Repeater in the Wix API Reference for more info on using code with repeaters.
https://www.wix.com/corvid/reference/$w.Repeater.html
Thank you Gos I’ll take a look now I appreciate your help.
I I think that will do, thank you
Hi Guys,
Me again i have been trying to get the button on my repeater to lead me to a dynamic page can anyone tell me what is wrong it keeps saying it can’t find my URL.
import wixLocation from ‘wix-location’;
$w.onReady(() => {
$w(“#myRepeater”).onItemReady(($w,dataItem, index) => {
let linkToDynamicPage = dataItem[‘(property/ID)’];
$w(‘#button6’).onClick(() =>{
wixLocation.to(‘/property/ID’)
});
});
})