Check Structure for Entry or Child of Entry I have setup a few different navigation lists through the Menus 0.9 plugin by Familiar. Within my website, I have setup several different site sections all through the same structure called, "General". They all share the same page template.

I would like to run a check to see if the page is "About" or is a child of "About" (all within the "General Structure"). If it is "About" or a child of "About", I would like to server it a specific sub-nav.

Here's the code to run that subnav:

{% nav node in craft.menus.getNodes('aboutSubnav') %}
&lt;li&gt;&lt;a href="{{node.link}}"&gt;{{ node.title }}&lt;/a&gt;&lt;/li&gt;
{% endnav %}


How do I do the lookup to see what page it is? I tried the following code, but it did not work:

{% if entry in craft.entries.section('general').descendantOf(42) %}
 {% nav node in craft.menus.getNodes('aboutSubnav') %}
 &lt;li&gt;&lt;a href="{{node.link}}"&gt;{{ node.title }}&lt;/a&gt;&lt;/li&gt;
 {% endnav %}
{% endif %}
The containment operator in does have problems working with whole element models. I'd try and modify your conditional to compare entry IDs instead:

{% if entry.id in craft.entries.section('general').descendantOf(42).ids() %}
    ...
{% endif %}


To include that parent page ID to that array you would do that with the merge filter:

{% set aboutPagesIds = craft.entries.section('general').descendantOf(42).ids() %}
{% set aboutPagesIds = aboutPagesIds|merge([42]) %}