How to setup a link to open in current tab when using Wix Pro Gallery with a dataset

Hello there,
I have done some research around the forum, but I can’t find the answer for this issue.

I currently have a Wix Pro Gallery connected to a dataset - everything is in order. When I click an item of my gallery the link from my dataset opens just fine, but inside a new tab. So I’m wondering how do I make my link open in the current tab .

I’ve seen some people using these kinds of code to open a link inside the current tab, but it doesn’t work when the element is a gallery.

$w.onReady(function () {
$w("#myElement").target = "_self";
});

Thanks for reading my post.

You can’t use -----> .target = “_self”; on a —> GALLARY !!!

Why ???

Because this property do not exist on a GALLARY…
https://www.wix.com/velo/reference/$w/gallery

You can use this attribute on a → BUTTON ← for example.
https://www.wix.com/velo/reference/$w/button

If Wix do not offer such options —> you simply can’t use it.

The only way would be to generate your own CUSTOM-GALLERY from scratch inside a CUSTOM-ELEMENT or an HTML-Component (iFrame):

But this would be a lot of CODE and working TIME !!!