Hello everyone,
I’ve been using Editor X to create a blog for my website. I customized the post page using a dynamic page and created a dynamic list page to show a list of posts based on tags. However, I’ve encountered an issue where the titles in the repeater on the dynamic list page are not clickable, and the only way to open the post page is by clicking the “Read More” button.
I’ve tried using the “Link to Page” option in the Navigation panel of the Inspector to make the titles clickable and linked to the dynamic post page, but the option is deactivated when the element is connected to the dataset.
I would greatly appreciate it if anyone could help me find a solution to this issue. Is there a way to make the title element clickable and link it to the dynamic post page?
Thank you in advance for any help or suggestions you may have.
Hey @rashad-qado !
So, when bound to data, the text element won’t be linkable to any page. That being said, it is possible using a little bit of code.
From the sounds of it, here is the code you’ll need:
import wixLocation from 'wix-location';
$w.onReady(function () {
$w("#datasetID").onReady(() => {
$w("#repeaterID").onItemReady(($item, itemData, index) => {
$item("#textID").onClick(() => {
wixLocation.to(itemData.postPageUrl)
})
})
})
})
Change datasetID to the ID of your dataset
Change repeaterID to the ID of your repeater
And change the textID to the ID of your text element
If you need any more help with the code, I’d recommend reaching out on the Velo forum