Show/hide a button if there is a link

I got a dataset with businesses (name, address, etc.). There is also a field with the url to the website of the business.
I want to hide/show a button with the link to this website.
If the url is in the database , show the button, if the field is empty, hide the button.
I got almost no knowledge of Java. If anyone could give me some help, or show me a reference to an example, it’s highly appreciated.

1 Like

Hi Bruno,
Did you figure out the code? I would love to implement this as well? I am creating a website similar to yours.

Hi!

You could achieve this functionality by using several methods from our API list.
First, in order to hide/show an element use the show( ) / hide( ) functions.

In order to achieve the desired conditional effect (show the button only when there’s a URL) you’ll need an
If / else statement that will determine what course of action to take.

Last but not least, you’ll need to access the data in order to decide rather there is a compatible URL or there is not. In Wix Code the way to do it is using the Wix Data API and specifically - the WixDataQuery .

combining these three methods you should be able achieving your goal.

Doron.

This explenation does not seem to be an solution at all if i got help like this i would be screwed. the guy on top is exually saying he doesnt know much bout coding… this is not a solution

If you have a specific issue you need help on, please open your own post, with your own topic and describe your issue as most detailed as pissible. It is useless to bump-up old posts.

But you can link related or similar post with similar or identical topics to give your issue more details.