I am working on a site where I have created a database to handle a user dashboard. I have a button link on my dashboard, which links to a URL field in the database (it links to a page on my site specific to that user). I have it working, but when I click on the button, it opens the page in a new window. How can I get the button to use the database URL but open the the page in the same window. I found this code in another post, but I must not be calling it properly on my click:
import wixLocation from âwix-locationâ;
export function button1_click_1($w) {
let link = $w(â#button1â).link;
console.log(link);
wixLocation.to(link);
}
import wixLocation from âwix-locationâ;
export function image1_click_1($w) { let link = $w(â#image1â).link;
console.log(link);
wixLocation.to(link);
}
$w(â#image1â).target = â_selfâ;
Im not getting anything in the console which is strange.
Also its not working. When you hover over it you can see the link, and if you right click and say open in new tab it opens. But clicking does nothing.