Combine "wixLocation.to" with "target=_blank."

I was looking for this feature and found out that
“It is not possible to combine wixLocation.to with target=_blank.”

I have repeaters with publications names that are too long to be a button element.
I try to link them to a PDF file of the publication, but it open on the same window only, because there is no way to add the target=_blank

Thanks

1 Like

The wixLocation.to is a function to redirect a user, not send the user to a new page. If you want to send the user to a new page you should use the .link property of the element clicked that also supports target. Read more about buttons link and target property here.

You can also use the openModal if you just want to open some content from some page outside the Wix Structure.

Thanks Andreas,
apparently I’ll have to use the text as a button, or add a button next to it.

Thanks Much Andreas,
the openModal works GREAT. I was trying to open an external PDF image stored on Cloudinary in another tab and found that the target=“_blank” did not work.

One improvement would be to make the Close window “X” a little more prominent…