I have a tree like this:

About Us
 - Alpha
 - Beta
 - Delta
  * Three Sub 1
  * Three Sub 2
  - Full time

When the current page is 'Beta', since 'Beta' does not have any child entries and is at the second level of navigation, I want to hide my navigation breadcrumbs.

I have the breadcrumbs displaying fine, but how would I use a condition to check that a node is both at a certain level, and also has no children?


You can get information about any node via the get_node tag.

From there, you can find out if the node has children, as well as the depth of the current node.

Something like:

{exp:taxonomy:get_node tree_id="1" entry_id="{entry_id}"}
    {if this_node_level > 2 && this_node_has_children}
        {exp:taxonomy:breadcrumbs tree_id="1" entry_id="{entry_id}"}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.