Help! Need a button to link to different urls based on username

Hello and thanks for any help in advance! I am trying to get a button on a page in the members area of our website to go to a specific external url (Airtable Base) based on the username of the member. Is there any way to do this? There are only 5 users, so hoping this could be somewhat straight forward. :slight_smile: Thanks again!!

Hello,

I assume that you have all the usernames saved in a database collection. You can query it and get the information of a current user, then use wixLocation.to() to redirect your member to an external site.

https://www.wix.com/corvid/reference/wix-data.html#query
https://www.wix.com/corvid/reference/wix-users.html#currentUser
https://www.wix.com/corvid/reference/wix-location.html#to

Thank you for your response! How can I do this specifically when a button is clicked?

You’ll need to read the following article about event handlers:
https://support.wix.com/en/article/corvid-tutorial-adding-custom-interactivity-with-events

Specifically, you can use onClick event handler.
https://www.wix.com/corvid/reference/$w.ClickableMixin.html#onClick