So here is the scenario. I have a dynamic page and one of the fields is the Twitter handle that is pulled from a data source formatted like this “@TwitterHandle”, this is how I want it to show up, but I want it to be clickable and go to “https://twitter.com/TwitterHandle”. So how can do this so that the URL concatenates the URL (minus the @) on click? I hope I am explaining this in a way that makes sense. I would even be fine with the data source containing the “TwitterHandle” without the @ in the first place. If that makes it easier.
1 Like
Can you not just do it a easy way and simply have a read only text field on your page that displays the ‘@TwitterHandle’ from the dynamic dataset and then have this text field linked to the actual website url field in your dynamic dataset.
You can try it using a button instead and just change the buttons label to the data from the dataset field instead.
- Connect the button link to a link field in a dataset / in a collection.
- Set the link value using code, using the $w(‘#button’).link = new value
- Have an onClick event on the button and implement an event handler.
https://www.wix.com/corvid/reference/$w.Button.html#link
Ah, thanks, I will try this.
Thanks for pointing me to the button option, it was actually even simpler, no code needed.