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.
Hi all! Would it be possible to implement a visibility rule for panes for taxonomy page panels which sets the pane visible only if the current taxonomy term is a last child term (has no children itself)?
Comments
Comment #1
cesareaugusto CreditAttribution: cesareaugusto commentedanyone may help?
Comment #2
BarwonHack CreditAttribution: BarwonHack commentedI too would appreciate this feature.
Comment #3
BarwonHack CreditAttribution: BarwonHack commentedI managed to get this working by utilising Term Parent and Context visibility rules.
My exposed filters now only display in a block when the term has no children. This is working on two- and three- deep categories.
Play with contexts then set up your visibility rules.
Comment #4
alexandersluiter CreditAttribution: alexandersluiter commented@smilne23 Could you lay out how you did this? I'm looking to implement this feature and having trouble with the Context visibility rules. I can hijack terms at specific depths, but I just want to hijack depths that have no more children.
Comment #5
alexandersluiter CreditAttribution: alexandersluiter commentedOk. I figured our a workaround for now. I was able to use this sandbox module to get a terms children in Contexts:
https://www.drupal.org/sandbox/Caseledde/2076789
I added "Taxonomy Children Context" as a relationship under the Contexts tab.
From there, I used a PHP Code selective rule as follows:
This will make it so your panel page will only hijack term pages that have no children. Enjoy!