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

cesareaugusto’s picture

anyone may help?

BarwonHack’s picture

I too would appreciate this feature.

BarwonHack’s picture

I 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.

alexandersluiter’s picture

Issue summary: View changes

@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.

alexandersluiter’s picture

Ok. 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:

$children = ctools_context_keyword_substitute('%term_children:tids', array(), $contexts);
if (empty($children)) {
return TRUE;
}

This will make it so your panel page will only hijack term pages that have no children. Enjoy!