Hi folks!
I currently have a repeater that’s linked to a database that contains a headline, thumbnail, and excerpt for external news articles, and I have a URL field in the database, so that the thumbnail and headline will link to the article we’re referencing.
As we all know, the photo database setting gives us the option to connect it the URL, but the textbox for the headline doesn’t, so I added the following code to Velo on the page, hoping to reference the URL field:
import wixLocation from 'wix-location';
$w.onReady(function () {
$w('#NewsArticlesRepeater').onItemReady((selector, itemData, index) => {
$w('#ArticleTitle').onClick(() => {
wixLocation.to(itemData.url);
});
});
});
And it worked!
However, that link is opening in the same tab. And I want to add some code to force it to open in a new tab.
Can anyone help?
The link to the page on my website is:
Thanks in advance.
Warmly,
Miss Hazel xx