Query Filter: Add Parent, Child of options for Taxonomy - Terms filter

Hi,
Currently we have the Filter Elements:

  • Fitler - Checkbox
  • Filter - Radio
  • Filter - Select

These Filter Elements can choose the Source as Taxonomy, for example I choose Post Category / Product Category. Everything is fine.

But I have a practical requirement to do on the following projects, my Taxonomy Category (Or Product Category) has the following hierarchical Terms:

A - Root
-- A - 1
-- A - 2
-- A - 3
-- A - 4
B - Root
-- B - 1
-- -- B - 1.1
-- -- B - 1.2
-- -- B - 1.3
-- B - 2
-- B - 3
C - Root

I need the Filter - Checkbox or Filter - Radio or Filter - Select to list only the child Terms of a parent Terms. For example, I just want to display a list of “chips”:
A - 1, A - 2, A - 3, A - 4. (There are actually a lot of them and they are dynamic update.)
With Bricks’ Query Loop, we can do that easily. But with the current Taxonomy query option, Query Filter, it is not yet. Please see the 2 attached images below.

Query Loop: Taxonomy query have Parent and Child of

Query Filter:

If there is any way to solve this issue using PHP (Hook, Filter), I would appreciate your help.
I hope Bricks Builder will add this feature to Query Filter in the near future.

Thanks
:bear:

3 Likes

I really need this too!

Bumping this up, as I came across a need of exactly that functionality!

In filter element, when choosing taxonomy → category, we should be able to choose “parent” and “child of”.

For example Parent {term_id}, so we only display sub-categories of the current term.

Then we can nicely filter a category by its sub-categories.

Please try to add to the next release.

Keep us posted, thanks!

P.S - @datgausaigon Did you manage to come up with a workaround solution?

Hi, @matt-cnc

I am currently using the exclude feature. I have to temporarily exclude each category that should not appear in the one that should appear. It’s very hard, but let’s deal with it like this for now because I have no other way at the moment. I think there is a way with PHP, but I haven’t had time to look into it yet.

Thanks
:bear: