Can I create tags to filter an index page?

I’m trying to accomplish something for a client that exists on a page on his other WordPress site: https://imakestuffforfun.com/tunage/

The page is an index for a video library. Each item in the index has a listing consisting of a group with a thumbnail image and text elements with title, description, etc. Each listing is tagged with one or more keywords

At the top of the page is a row of tags (keywords). When you click a tag, only the listings with the same keyword are displayed.

Can this be accomplished with a database and filters? Or is there another way to accomplish this within the Wix platform?

Thanks in advance for your help.

Hey David,

This can be accomplished in several ways.

First of all, create a collection where each row represents a video, and add columns for the thumbnail image and all the different texts.
Then, for example, if the number of keywords is relatively small, you can define a Boolean column for each of the keywords. Then each listing will have a True in a keyword column if it is tagged by that keyword, and False otherwise. Clicking on a keyword will filter only the listing with the True value, e.g. only the listings tagged by that keyword.

Another option, if the number of keywords grows bigger, is to define just 1 column called Tags, and store all the tags as a string, comma separated (Comedy,Original,NEW). You can then use a Wix Data query to find only listing that contain a certain keyword.

  • Please note, it is not yet possible to store actual videos in a Wix Collection, although we are working on it. In the meantime, you can upload your videos to either YouTube or Vimeo, and store only the urls in the collection. Then use a Social Video Player component to show the videos in your site.

Good Luck,
Itai

Thanks , Itai - OK, I have created a database with Boolean columns, each listing appropriately checked. I have created a Page that contains a repeater to display each item in the database. How do I set up the keywords on the page so when clicked they return the appropriate filtered Boolean results?

Hey David,

You can add a button for each keyword.
Then add On Click event handlers to each of these buttons. In the event handler function, set your dataset’s filter using this api: wix-dataset - Velo API Reference - Wix.com

Example code:

import wixData from "wix-data";
// ...
export function myKeywordButton_click(event, $w) {
	$w('#myDataset').setFilter(wixData.filter().eq('myKeywordColumn', true))
}

Can you post a solution for the second way using tags from a data set?

@simark95

You are much better suited making a new post about this and referring to this old post with a link instead of tagging onto this old post.

As for tag field in your dataset, note that the tags field is only available to be used with the checkbox group element
https://support.wix.com/en/article/about-user-input-elements
https://support.wix.com/en/article/adding-and-setting-up-a-checkbox
https://www.wix.com/corvid/reference/$w.CheckboxGroup.html

See previous posts for more info too.
https://www.wix.com/corvid/forum/community-discussion/importing-database-with-tags
https://www.wix.com/corvid/forum/community-discussion/solved-insert-multiple-tags-to-database-tags-field-at-the-same-time
https://www.wix.com/corvid/forum/community-discussion/database-tags
https://www.wix.com/corvid/forum/community-discussion/search-tags-database