Skip Navigation

[Resolved] A view that shows only one category with a checkbox that shows one more

This support ticket is created 2 years, 4 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: Africa/Casablanca (GMT+01:00)

This topic contains 1 reply, has 2 voices.

Last updated by Jamal 2 years, 4 months ago.

Assisted by: Jamal.

Author
Posts
#2235349

I am trying to create a view that shows only one category with a checkbox that when checked shows one additional one together with the first. The CPT has more than those two categories, but I want only those two to show.
In addition, I would like to have a text search that searches only in the first category or both respectively.
I have tried several approaches, but have not been able to figure it out.
Can you please point me in the right direction?

Truls

#2235419

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello and thank you for contacting the Toolset support.

I assume that you want to have a dropdown to select the first category, and a check box to display another dropdown to select a second category, right? If yes, it can't be implemented without some custom code. Toolset, by default, offers only one control for each filter. I will not render two select fields for the same taxonomy filter(categories).

On the first hand, Toolset does not have a built-in feature to toggle a filter based on a checkbox. You will require custom code to implement such a feature.

On the second hand, you will also need custom Javascript code in order to generate a second dropdown with the possible categories except the first one selected.

I would suggest a different approach. But, it will still require some custom code, at least to remove the first selected category from the second dropdown. I would suggest using a secondary taxonomy, and a 3rd party plugin to copy the categories to this new taxonomy. Then, have two taxonomy filters on the view, the first for categories, and the second for the newly created taxonomy.
For better user experience, custom Javascript code will be required to implement features such as: Disabling the second filter until the first one has a value, removing the first category from the second filter when selected.

I hope this helps. Let me know if you have any questions.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.