Hello guys! Happy to be part of Velo community.
So I have a “Press database” where I setted a column as URL so I can connect each press item to a .pdf article. The issue is when I click the button connected to the URL database field, the pdf downloads instead of opening in a new tab. I cannot link it manually to a normal button because im working with a repeater and it is connected to a dataset.
How do I make the repeater’s button to open the .pdf’s link in a new tab instead of downloading it?
Thank you very much in advance.
I disconnected the repeater’s button from the dataset url field and added the code below. Now, when I click it does open the url in a new tab, however it is not displaying the content. It shows a blank page with a ‘Forbbiden’ warning on the left top. Any further help please?
$w.onReady(function () {
$w("#repeater1").onItemReady(($item, itemData, index) => {
$item('#button2').link = itemData['link'];
$item('#button2').target = '_blank';
})});
SOLVED: Okey just to let you know in case someone needs help with this. I found out is a browser issue . The pdf automatically opens in a new tab if I use Chrome or Sarafi. The problem was Firefox was set to download pdf docs insted of opening them in a new tab. WIX’s dataset is automatically set to open any url in a new tab.
My bad. All best!