How to make a button in a repeater open in the same tab?

Hi there, i’m old to wix but absolutelly new to corvid and I have zero experience in coding, so I apologize in advance for any stupid things I’m about to say :slight_smile:

I’ve started using dataset and repeater in my site.

I’ve set up a button in order to open the dedicated page i need to open but alas it open in a new tab (I don’t undersand how this could be the default option)

I’ve found a corvid code that is supposed to fix this, and I copyed and paste it in the corvid section, but obviusly I’m doing something wrong.

This is the post I’m refering too [https://www.wix.com/corvid/forum/community-discussion/repeater-open-link-in-same-window](https://www.wix.com/corvid/forum/community-discussion/repeater-open-link-in-same-window

an)

And this is the code:
import wixLocation from ‘wix-location’;

export function button1_click(event, $w) {
let link = $w1(“#button1”).link;
console.log(link);
wixLocation.to (link);
}

So, i do i implement this code? Do i just paste it in to the corvid editor as i’ve done here?

Can anybody troublshooting what is going on?

$w("#repeater1").onItemReady(($i, iData) => {
    $i("#button1").link = iData.link;
    $i("#button1").target = "_self";
})

Hi JD! Thanks very much… what is this? I mean, is a integration? is the actual code I should use? Where should I paste it?

Sorry but totally new to corvid.

Thanks

@info11753 First, understand that this forum is a community of Corvid developers and users where various topics are discussed and information shared. It is not a support site.

To learn about programming with Corvid, read the following articles that will help you start working with Corvid:

If you find that you are having difficulty with code and need assistance, you may want to check out the Wix Marketplace - it’s a place where you can look for Corvid experts for hire.

Hi, thanks very much Yisrael, i was actually looking for those tutorials but couldn’t find them! I will start with those!

By the way! I’ve understood what I did wrong and used the code that JD provided and IT WORKS! Thanks!