I have a filter set up ... and I need it not to show a filter if there are no taxonomy items. the filter is based off of a taxonomy.
current filter :
<div class="nav_fil_box">
<label for="wpv-release-quarter">[wpml-string context="wpv-views"]<h3 class="rm_fil_title">Filter by Discovery Roadmap</h3>[/wpml-string]</label>
<div class="form-group rm_nav_group">
[wpv-control-post-taxonomy taxonomy="release-quarter" type="checkboxes" format="%%NAME%%" url_param="wpv-release-quarter"]
</div>
</div>
** i need the above not to show up if taxonomy="release-quarter" has no post items associated with it. This is so there is not just a blank box.
is this possible?
I tried using conditional statements .. but had no luck..
Hello and thank you for contacting the Toolset support.
Unfortunately, Toolset views do not have a way to tell if a taxonomy filter has any values. The only way, I can think of it, is by using custom Javascript code. You can add a custom Javascript code that will check if the filter has any values, if it does not, it can hide it.
If the view is using AJAX, you will need to listen to the views' events to trigger the custom code. Check this article about views' events in this article:
https://toolset.com/documentation/programmer-reference/adding-custom-javascript-code-to-views-that-use-ajax/
I hope this helps. Let me know if you have any questions.
My issue is resolved now. Thank you!