I think that Connecting with Dataset to display same value with dataset tags
is broken somehow.
All fields are disabled and won’t turn on even with same value.
I tested with multiple selection and It was executed correctly… Please Help!
I think that Connecting with Dataset to display same value with dataset tags
is broken somehow.
All fields are disabled and won’t turn on even with same value.
I tested with multiple selection and It was executed correctly… Please Help!
@vividacademia All tags are disabled? Could you please check if your dataset permissions are Read-Only?
If so, this is the expected behaviour.
Oh…
then It can’t use as , whatever it called, visual checker?
I want to use with dynamic pages.
kind of genre, major or something else
Code for Single Selection at the time:
export function Selectiontag1_change(event) {
let selectedIndices = $w(“#Selectiontag1”).selectedIndices;
let n = selectedIndices.length;
let selected = selectedIndices[n-1];
if (n===0){
$w(“#Selectiontag1”).selectedIndices = ;
}else{
$w(“#Selectiontag1”).selectedIndices = ;
$w(“#Selectiontag1”).selectedIndices = [selected];
}
My selection tags are not showing data when they’re selected. The data in the repeater is only showing when the selection tags are not selected.
import wixData from 'wix-data';
const collectionName = 'VideoCoursesUploads';
const fieldToFilterByInCollection = 'tags';
$w.onReady(function () {
setRepeatedItemsInRepeater();
loadDataToRepeater();
$w('#tags').onChange((event) => {
const selectedTags = $w('#tags').value;
loadDataToRepeater(selectedTags);
})
});
function loadDataToRepeater(selectedCategories = []) {
let dataQuery = wixData.query(collectionName);
if (selectedCategories.length > 0) {
dataQuery = dataQuery.hasAll(fieldToFilterByInCollection, selectedCategories);
}
dataQuery
.find()
.then(results => {
const itemsReadyForRepeater = results.items;
$w('#VideoCoursesUploadsRepeater').data = itemsReadyForRepeater;
const isRepeaterEmpty = itemsReadyForRepeater.length === 0
})
}
function setRepeatedItemsInRepeater() {
$w('#VideoCoursesUploadsRepeater').onItemReady(($item, itemData) => {
$item('#videoupload').src = itemData.video;
$item('#videotitle').text = itemData.title
$item('#videodescription').text = itemData.description;
})
}
I figured what the problem was.
const fieldToFilterByInCollection = 'tags';
The name of this variable did not match the field name in the database.
Thanks, the selection tags had been working well on this site ( https://www.covid19recoverytexas.org/resources ) . I connected one set to a user input database and the other to a sorted, read-only database.
However as of today the formatting of the selection tag buttons changed on Wix, so that when a button is clicked, it never registers as the right format (blue lettering on white); additionally the ability to change the font size on the selection button in the mobile version was removed.
Does anyone know if the Wix team is actively fixing the Selection Tags? And/or is there a quick way for me to fix this in the Corvid editor? As the site is for resources needed now & people are trying to use the site, I hoped to get it fixed asap. Thanks for your help!
@aminaq Thanks Amina for reporting! Yes, we encountered the bug earlier today and are working on a fix.
…it would be a formatting change to the selection button within the onChange, onClick event.
Thanks
@aminaq Fix has been released. Please let us know if you encounter anything additional. Thank you!
Thanks, Eyal - looks great!
Will selection tags be coming to EditorX soon?
Hi guys,
here is code how to display tags from database in selctectionTags user input field inside repeater.
Can we use selection tags to filter a gallery that is populated by a dataset? It seems like it should be possible based on your repeater example but I cannot get it to work.
To clarify, I made a collection of (design) “Projects” with different fields for ProjectTitle, ProjectDescription, ImageThumb, & then a Tags field (with about 5 or 6 different tags possible across the various projects). I was able to figure out how to populate the Gallery on my (non-dynamic) page with the Projects using a dataset. I can “filter” as I want based on the tags. But, I cannot link a “Selection Tags” element (Add > Input > Selection > Selection Tags) to different filters for that Gallery. I’m not even really sure how to link a single “tag” to one of the filters. Is there a step-by-step approach to this for a designer-not-coder?
Hi @jkwarner ,
Would you like to display only the items that match any of selected tags? All of the selected tags? Something else?
Perhaps you will find my answer above to Luke Arnold helpful. Please check out this example website . Is this what you are trying to achieve?
If so, I’m afraid that at the moment this indeed involves a few lines of code.
Avoiding code altogether would require the ability to filter directly from the Selection Tags Input Element, as in the image below.
This is on our backlog. I will update as seen as it is made available.
HTH
Selection Tags could take a while to make it to Editor X. There are quite a few other elements that are planned to be added before it. Will update once work begins.
Needing some help!
I actually had success with this, then of course changed something and forgot to copy paste my code. I couldn’t recover it but here is the updated version (below).
I want to create an Inclusive version such as in your previous example ( https://eyalcwix.wixsite.com/selectiontags-filter ) for my recipes. My problem is that when I click the Selection tag, no data filters - completely blank! Here is my website page for reference https://www.juliabazanfoodandnutrition.com/recipes1
TIA!
Ps: I don’t really want the “no results found” notice when no results meet criteria, just left blank
import wixData from ‘wix-data’ ;
const collectionName = ‘Recipes’ ;
const fieldToFilterByInCollection = ‘tags’ ;
$w.onReady( function () {
setRepeatedItemsInRepeater()
loadDataToRepeater()
$w( '#selectionTags1' ).onChange((event) => {
const selectedTags = $w( ‘#selectionTags1’ ).value
loadDataToRepeater(selectedTags)
})
});
function loadDataToRepeater(selectedCategories = ) {
let dataQuery = wixData.query(collectionName);
if (selectedCategories.length > 0 ) {
dataQuery = dataQuery.hasAll(fieldToFilterByInCollection, selectedCategories);
}
dataQuery
.find()
.then(results => {
const itemsReadyForRepeater = results.items;
$w( ‘#repeater1’ ).data = itemsReadyForRepeater;
const isRepeaterEmpty = itemsReadyForRepeater.length === 0
})
}
function setRepeatedItemsInRepeater() {
$w( ‘#repeater1’ ).onItemReady(($item, itemData) => {
$item( '#image' ).src = itemData.image;
$item( '#image' ).tooltip = itemData.image;
$item( '#title' ).text = itemData.title
})
}
Hi! I’m trying to set up a page like the “recipes” example given by you guys. At the moment the repeater is working fine but the SelectionTags aren’t displaying the Tags field set on the database. I’m quite new to wix so maybe there’s a step I’m missing out here…
My selection tags were supposed to be Countries added in the database.
This is my code at the moment
import wixData from ‘wix-data’ ;
const collectionName = ‘Posts’ ;
const fieldToFilterByInCollection = ‘country’ ;
$w.onReady( function () {
setRepeatedItemsInRepeater()
loadDataToRepeater()
$w( '#selectionTags2' ).onChange((event) => {
const selectedTags = $w( ‘#selectionTags2’ ).value
loadDataToRepeater(selectedTags)
})
});
function loadDataToRepeater(selectedCategories = ) {
let dataQuery = wixData.query(collectionName)
if (selectedCategories.length > 0 ) {
dataQuery = dataQuery.hasAll(fieldToFilterByInCollection, selectedCategories)
}
dataQuery
.find()
.then(results => {
const itemsReadyForRepeater = results.items
$w( ‘#repeater2’ ).data = itemsReadyForRepeater;
const isRepeaterEmpty = itemsReadyForRepeater.length === 0
})
}
function setRepeatedItemsInRepeater() {
$w( ‘#repeater2’ ).onItemReady(($item, itemData) => {
$item( ‘#text44’ ).text = itemData.title
})
}
I’ve connected the Selectiontags to the database (image below), but when I preview it doesn’t display the countries set on the database, and still shows the options “tenis”, “football”, “basket”.
Thank you in advance!
So none of these examples are working for me on my site does anyone know if there was an update made that broke these examples by any chance?