How to change code in corvid template?

Hello everyone!

I need to change a simple link from _blank to _self, I am using dropdown template and database, but still I can´t find a way to do it.

Any help or info about it is appreciated. Thank you all!

I´ll share images of the project.

You haven’t added any code yourself, that is why you don’t see any in your own code area.

If you connect to a field through the dataset then it will open up in a new tab.
https://support.wix.com/en/article/connecting-a-button-to-a-database-collection
Fields
Link to a URL, file, image, or video field in your collection. If you link to a URL field, that page is opened in a new tab. If you link to a file, image, or video field, the media stored in that field is downloaded to your visitor’s device.

As it clearly shows in the html code in your top pic that it will open the link as “_blank” (the link opens in a new tab or window.)

Jeff (Wix Mod) had a great little solution that fixed this previously, so you can try it out by using the code example added below from him.

I would thoroughly advise you to read the two links that Heath linked for you from the Wix API reference so that you have an understanding of what the code is meaning and doing.

Just add this line into your pages onReady function.

$w("#button1").target = "_self";

You’ll need to replace “button1” with the name of your button. So in the end your code should look like this.

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

And that’s it. You can then still use the Connect panel to make your button link to the URL in your collection. All this code does is tells the button that it should open any links in the same tab.

Thank you so much!