Display Tags based on Previous Selected Tags from a Data Collection.

So I have a Data Collection where the user selected Tags on a form. I want to Display these Tags on their user profile page (I only want the tags they selected to be displayed). I also want to allow these tags to be reselected as filters on a gallery connected to other profile pages.

Is there any code ideas to make this happen? If I can get some help to the right direction that will be appreciated. thank you.

Collection: userProfileData
Dataset: datasetRead
Tags Field: categoryTags
Element: profileTags

The description is not clear enough. Please rephrase and elaborate,

I hope this explanation is a little better to understand.

I have a Collection with data from a form users filled to create a Dynamic Page. In the Form the users selected some tags from about 90 options.

In the dynamic page, created from the form, I want to display the selected tags (not all 90, but only the tags that were selected and stored in the collection) these tags would then be used by the user to filter a repeater element in the dynamic page.

I’m looking to be pointed to the right direction in terms of wixcode to Display the tags from the collection field and use them as a filter to a repeater.

Example: the user selected 15 out of the 90 tags in the form to create the dynamic page. In the Dynamic Page I want to ONLY display the selected 15 as options to filter the repeater .

**This Tag options would vary depending on who the logged in user is.
I hope that explains what I’m trying to do. Thank you for your help and patience.

I don’t know what data you have in the repeater.
But let’s say you have 2 datasets on your page:

  1. userDynamicDataset (which represents the user selection data item)

  2. repeaterDataset (which represents the general selection tag items, where the title is the selection tag value)
    Then do something like:

let dataReadyStatus = 0;
$w.onReady(() => {
$w('#userDynamicDataset, #repeaterDataset').onReady(() => {
dataReadyStatus++;
if(dataReadyStatus > 1){
    $w('#repeaterDataset').setFilter(wixData.filter()
    .hasSome('title', .$w('#userDynamicDataset').getCurrentItem().tags)
    )
}
})
})

@jonatandor35 Thank you, I’ll try to see if I can use this information.

But to clarify my main problem its actually displaying the tags from the dataset.
Just so you have a little visual of what I’m trying to do: The page where this will be taking place is not in a dynamic page, it will be from a members only page. the filter Tags you see under the Image here is where my problem is; I want to display tags only from the logged in Users Data already previously selected and stored. then I want those Tags to be used to filter the Gallery Repeater that will show a list of all Dynamic Pages by different users.

As of right now I use this code to display tags, but its not clean being an HTML code that breaks when there is a space and doesn’t maintain the tag as a whole. Example you can see where the tag breaks for “Emergency Response Units” if there is a way to display tags from a dataset using the Tags input element I’ll appreciated.


This is the code I’m using to Display these tags (Different from what I am working on)
$w . onReady ( function () {
let tags = $w ( “#dynamicDataset” ). getCurrentItem (). tags ;
let tagsHtml = tags . map ( tag =>
<span style="background: #ff0000; border-radius: 5px; line-height: 2.6; padding-top: 5px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; margin-left: 0px; margin-right: 0px; text-align: center; color: #ffffff; font-weight: 700; font-size: 12px"> ${ tag } </span> )
. join ( ’ ’ );
$w ( ‘#displayTags’ ). html = tagsHtml ;
});