Tell us what you are trying to do?
An online platform for students to submit their exercises. We have different Semesters, Courses and Students. I want to show only a subset of the “student desk taxonomies”? Since I cannot delete old ones because they are needed for the old submissions, the taxonomy list will become very long after a while. Do you have an idea, how I can create a new list of taxonomies e.g. for each semester and hiding the old ones?
Is there any documentation that you are following?
https://toolset.com/documentation/user-guides/front-page-filters/
What is the link to your site?
hidden link
Hi Sylvia,
Thank you for contacting us and I'd be happy to assist.
There is no attribute supported in the shortcode "wpv-control-post-taxonomy" which can be used to include or exclude specific taxonomy terms ( ref: https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-control-post-taxonomy ), however, you can use custom CSS code to hide the specific select options from the list.
For example, for a select field with the name "wpv-student-desk-taxonomy", you can hide "Exercise 1" and "Exercise 10" options, by using their slug values in the code, like this:
select[name="wpv-student-desk-taxonomy"] option[value="exercise11"],
select[name="wpv-student-desk-taxonomy"] option[value="exercise-10"] {
display: none;
}
Feel free to include the slugs of the options which you'd like to hide and this custom CSS code can be added in the "CSS editor" tab under the "Search and Pagination" section of the view.
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar
Dear Waqar,
Did I understand you correctly that:
1.shortcode "wpv-control-post-taxonomy" does not provide the option to include or exclude specific taxonomy from the search.
2. it is possible to exclude some exercises from CSS editor using the slug that you provided.
So, using slugs in CSS editor os only option, to manage taxonomies?
If I want to use the slugs in CSS, it means that we have to manually control the list of taxonomies every time when we want to exclude or include a certain group of taxonomies?
Best,
Sylvia
I also tried to remove the whole group of exercises, using slug in CSS, just to avoid typing each exercise.
select[name="wpv-student-desk-taxonomy"] option[value="iudd-wise-19-20"] {
display: none;
}
But, unfortunately, it hides only the one line with "IUDD_WiSe_19/20" taxonomy instead of hiding the whole set of exercises that belongs to "IUDD_WiSe_19/20" taxonomy.
Is it possible to hide the set of taxonomies that belong to a certain taxonomy higher in the hierarchy?
Hi Sylvia,
Thanks for writing back and your understanding is correct.
1.shortcode "wpv-control-post-taxonomy" does not provide the option to include or exclude specific taxonomy from the search.
- Yes, this shortcode doesn't provide any attribute or filter for the inclusion or exclusion of specific terms, but you're welcome to submit a feature request for this at:
https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/
2. it is possible to exclude some exercises from CSS editor using the slug that you provided.
So, using slugs in CSS editor os only option, to manage taxonomies?
- Yes, using the custom CSS code to hide the unwanted terms is the simplest and most efficient workaround in this case.
The term options are not shown in the select dropdown as a set or in the hierarchal manner, which means that you'll have to add the slugs of all the unwanted terms individually, as shown in the example, in the last reply.
( ref: https://toolset.com/forums/topic/show-only-a-subset-of-the-taxonomies/#post-1317673 )
Once, you've included the slugs of all old terms which are not wanted in this select field, they'll not appear in the dropdown.
regards,
Waqar
in this case, probably there is a slug that can find a set of taxonomies?
something like:
select[name="wpv-student-desk-taxonomy"] option[from value="exercise-1" to value "exercise-5"],
{
display: none;
}
Sorry, I am not a professional developer, so it is just my random idea.
Hi Sylvia,
Unfortunately, the CSS language currently doesn't support a selector through which a range of values ( to and from ) can be set.
You can read about the available selectors, from this guide:
hidden link
( screenshot: hidden link )
Tip: If you can design the slugs of your terms in such a way that the terms which need to be shown include a special text e.g. "special", you can write your custom CSS code like this:
select[name="wpv-student-desk-taxonomy"] option:not([value*="special"]) {
display: none;
}
The above code will make sure that only those terms are shown in the select field, which includes the text "special" in the slug.
regards,
Waqar