I’m using the RT widget and I’m creating a list that has multiple links on it. I use the built in url selector but I need to append ?letter=_ to the end of each link. I’m using the percussion url button so that the page can be moved and the links won’t be broken.
How can I do this?
I would use jQuery to accomplish this. Here’s one method: once you’ve created a managed link using the “Insert / edit link” function, view the link in source mode and manually add a class to the anchor tag, such as class=“letterVar”.
Once that is in place, add this jQuery code to the “Code insert before body close” input field in your page’s meta-data:
return this.href + '?' + 'letter=_'; <br /> });</script>```
Now, no matter how often you move the target page around, the link will remain accurate, and “?letter=\_” will be appended to the end of it.
Thanks nathaniel. How would I replace the _ with a letter which happens to be the text of the hyperlink.
Nevermind, I answered my own question. this.text.
Great solution – thanks for sharing.
I would like to add that I think having the ability to add additional URL parameters as part of a hyperlink would be a good idea.