Hi fellašš½, ever wanted to display WIX tags on your website? The you are in the right place. This won't take long, you can go ahead to copy the code below. I will be giving a few pointers on how to use the code.
What you will know
How to use text HTML feature
How to display tags on regular page
How to display tags on a dynamic page
The code below represents the code for a static page. Firstly, an array (tags) is created. This array contains the keywords.
tags = ["Food", "Bread", "Delicious", "Restaurant", "Yummy", "Foodie"];
These keywords are the tags we want to display. So you can go ahead to add as many as you want in the same format as the rest.
Next, we are going to use the Javascript Map() method to apply a HTML formatting on each of the words to make them appear as buttons. And then using .Join() method to combine them to form a group of buttons: This is what then becomes our tags group display.
We will further go ahead to add the next code to display the tags on a repeater. This method is pretty simple because we will be making use of onItemReady repeater function. This will enable us to retrieve the tags from our database using itemData option.
Finally, we will display the tags in a dynamic page. This process is pretty easy way to because we are also still retrieving data from our dataset but using the dataset getCurrentItem() method.
I hope you enjoyed this tutorial, check out my YouTube here
Code
Leave a comment (0)
Thanks for leaving a commentš