You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Block to show sub-catagories from selected parent-catagorey. #10
As the title suggests, I am looking for a solution to show nested "sub-categories" from a selected "parent-category". Basically what the default "categories" block does but from a specific "parent-category". I'm using your plugin now and I think the logic is there, just needs a few tweaks.
I know Python quite well but I don't know PHP or javascript so I'm at a loss here. I'd be happy to help test it out in my site if that is of use.
That's exactly what I was looking for when I discovered the plugin!
It works wonderfully well and I'm grateful for the work done!
Categories are great but when you have lots of them, it creates a huge list with elements that are not always relevant. Being able to refine the list for subcategories would be amazing. Typically, I'd like to propose sub-elements from 'Clothes' or from 'Furnitures' but not all types at once.
Looking forward to hear from you guys!
EDIT:
This can be hardcoded in 'build/taxonomy/render.php' by adding a 'child_of' but an option in the backend would be lovely. $terms = get_terms( [ 'hide_empty' => true, 'taxonomy' => $attributes['taxonomy'], 'number' => 100, 'child_of' => 162, //insert your parent category ID here ] );
oh cool,
that's what i am looking for! i adapted the original code starting with your approach and customised it for my needs, where i make the dropdown list both parent and child categories, like this:
parent 1
–– child 1a
–– child 1b
parent 2
–– child 2a
–– child 2b
–– child 2c
it would be great to see this feature implemented in the plugin update some time in the future. in the mean time i'll have to hard code it in 'build/taxonomy/render.php'. i am sure my code can be improved – feel free to add your suggestions!
Activity
JagUlysse commentedon Mar 14, 2025
That's exactly what I was looking for when I discovered the plugin!
It works wonderfully well and I'm grateful for the work done!
Categories are great but when you have lots of them, it creates a huge list with elements that are not always relevant. Being able to refine the list for subcategories would be amazing. Typically, I'd like to propose sub-elements from 'Clothes' or from 'Furnitures' but not all types at once.
Looking forward to hear from you guys!
EDIT:
This can be hardcoded in 'build/taxonomy/render.php' by adding a 'child_of' but an option in the backend would be lovely.
$terms = get_terms( [ 'hide_empty' => true, 'taxonomy' => $attributes['taxonomy'], 'number' => 100, 'child_of' => 162, //insert your parent category ID here ] );pigsound commentedon Jun 10, 2025
oh cool,
that's what i am looking for! i adapted the original code starting with your approach and customised it for my needs, where i make the dropdown list both parent and child categories, like this:
parent 1
–– child 1a
–– child 1b
parent 2
–– child 2a
–– child 2b
–– child 2c
it would be great to see this feature implemented in the plugin update some time in the future. in the mean time i'll have to hard code it in 'build/taxonomy/render.php'. i am sure my code can be improved – feel free to add your suggestions!
code (starting from line 21):