Skip Navigation

[Resolved] show only a subset of the taxonomies

This support ticket is created 5 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 6 replies, has 2 voices.

Last updated by Waqar 5 years, 3 months ago.

Assisted by: Waqar.

Author
Posts
#1317557
taxonomies.jpg

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

#1317673

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

#1317815

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

#1317829

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?

#1317837

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

#1317881

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.

#1318743

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