I am using Toolset Views 3.0-b2 (Blocks beta version)
I am trying to: create a search filter on an archive page. It's a CPT archive page, and the search filter will allow a user to filter by taxonomy.
Link to a page where the issue can be seen: hidden link
I expected to see: the checkboxes reflecting the taxonomy's hierarchy (see attached screenshot of my taxonomy's hierarchy)
Instead, I got: the checkboxes without the taxonomy's hierarchy – you cannot tell that some taxonomies should be nested under others. Instead it looks like a flat list that's not in ABC order.
Hi Jesse,
Thank you for contacting us and I'd be happy to assist.
I'm afraid, whether the classic views or the new blocks views editor is being used, the taxonomy term checkboxes are shown without the hierarchical structure.
You're welcome to submit this as a feature request, through the dedicated form:
https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/
For now, a workaround can be to use custom CSS code to control the layout of those checkboxes, manually.
regards,
Waqar
Thanks for your help. I am curious why this would be a feature request instead of a bug to be fixed?
Regarding using CSS as a workaround: can you clarify if there is a way to target the sub-categories separate from their parents? The HTML output looks identical. The only way I can think of to use CSS in this case is to target the IDs for each checkbox, but obviously this won't affect any categories added in the future and would require additional CSS any time a sub/category is added. Is there a way to add classes to the checkboxes to differentiate between sub-categories and parent categories?
Thanks for writing back.
If a feature is available but is not working as intended or if something was previously working but not now, that would be treated as a bug.
But the request to include a new feature or enhance the functionality of any existing feature would be treated as a feature request.
Your observation about the generated markup for those checkboxes is correct and there is no class or ID available which can be used to target items based on their hierarchal level. From manual CSS code, I meant that you can either use IDs of individual checkboxes or use "nth-of-type" selector ( ref: hidden link ).
I can understand that this manual CSS targetting is not ideal as it will constantly need to be updated with changes to those taxonomy terms. Alternatively, you can use a taxonomy view to get the slugs of all the parent terms, to generate the custom CSS code for them dynamically.
This means that in your original view, there will be static custom CSS code, that will apply to all checkboxes. And then there will be a taxonomy view called in this original view, which will include some dynamic CSS code, which will have the IDs of only the parent level terms so that they can be differentiated from the child terms.
I hope this helps and please let me know if you need any further assistance around this.
I must argue that this is a bug. This is not intended behavior – the other search filters (select dropdown, select multiple, set of radio boxes) show the proper taxonomy hierarchy, but it is missing in the set of checkboxes.
The taxonomies are grouped by parent (as opposed of being in alphabetical order) in all of the search filters. Since there is nothing differentiating children from parent in the checkboxes, it looks broken because the list appears to be in random order.
Nested taxonomies are part of WP core, so a complicated workaround such as using a taxonomy view to get the slugs of the parent terms should not be necessary. The HTML output should at least somehow differentiate between parent and child, even if it means I need to apply my own CSS to differentiate them visually.
I have submitted a feature request but am hopeful that you can escalate this as a bug. If this is indeed intended behavior, please explain, maybe I am missing something or not understanding how others might want to use it with its current functionality. Thank you!
Also, I opened an additional ticket with another issue I'm having with this search: https://toolset.com/forums/topic/show-only-filter-options-with-results-isnt-working/ – just in case you want to take a look at that too, since you are already familiar with my search filter. Thanks!
Thank you for waiting and I stand corrected.
You've made an excellent point about the terms showing in the hierarchy with all other types of fields ( e.g. "select", "radio", "multi-select" ).
I was able to confirm the same on my own test website too and it does make sense that it should be showing the hierarchy with checkboxes too.
I've escalated this to the concerned team for further review and will keep you updated through this ticket.
(your other ticket is also in my follow-up list)
Thank you for bringing this forward and I apologize for missing the bigger picture earlier.
Thank you very much! I look forward to this being fixed.
Hello, I have updated to the latest version of Types and Blocks, but the checkboxes are still not showing the hierarchy.