Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When I use this module as exposed filter in a views I would like to hide terms that not have associated nodes.
How can I do this? Is it possible to do?
Thanks a lot!!!
Comments
Comment #2
stBorchertHi.
I thought, we had a similar support request and I had given some example on how to do so. But I couldn't find it anymore so here is a quick answer.
You need to implement
hook_shs_term_get_children_alter()
(see shs.api.php) loop through the given terms and remove all terms without children from the list.Unfortunately the structure of
$terms
isn't really simple; please have a look atshs_term_get_children()
in shs.module on how this array is built.hope to help,
Stefan
Comment #3
Nikolino CreditAttribution: Nikolino commentedThanks stBorchert for your answer.
After your reply I also found this post.
https://www.drupal.org/node/1926252
But unfortunately I'm not able to implement it. I'm not very good with the code.
Are you able to help me?
Comment #4
stBorchert