Hello, would anyone be able to guide on how to link a button on my dynamic page to a url in my database?
Essentially, if the user is on ‘page a,’ and clicks on the link, I want the button to be connected to the ‘url’ field for ‘a’ from my collection/database. I am planning to use $w.Linkablemixin to use .link and .target, so that I can get the url to open-up in the same window. Any help?
Thanks Yoav. For some reason, it is the other way round for me. I am not sure if there is a glitch in the system, or if I am doing something wrong. Would you mind taking a quick peek at this page: The two buttons on the top are linked to the same url field in the database, but for some reason, the links are opening in a new window.
I tested it and got the same thing you did, so I think maybe Yoav just got it backwards. In any case, the fix is really easy. On your dynamic page add the following line to the onReady function at the top of the page.
$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.
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.
OMG! Thank you so much… I was way overthinking the entire thing for the past 3 days. I appreciate your help… you just saved me hours/days worth of repetitive work.