title: Django-CMS: How do I get a parent item of a currently active child page to highlight in the navigation menu?
body: <p>The standard menu.html that comes with Django CMS seems really easy but I simply can't figure out how to highlight a menu item that has children that are currently active.</p>
  
  <p>I tried this:</p>
  
  <pre><code>{% if child.children and child.selected %} active dropdown{% endif %}
  </code></pre>
  
  <p>But that, for some odd reason, doesn't work.</p>
  
  <p>Below is the full code of the menu.html:</p>
  
  <pre><code>{% load i18n menu_tags cache %}
  
  {% for child in children %}
      &lt;li class="{% if child.ancestor %}ancestor{% endif %}
          {% if child.selected %} active{% endif %}
          {% if child.children %} dropdown{% endif %}
   ---&gt;   {% if child.selected and child.children %} active dropdown{% endif %}"&gt;
          {% if child.children %}
              &lt;a class="dropdown-toggle" data-toggle="dropdown" href="#"&gt;
                  {{ child.get_menu_title }} &lt;span class="caret"&gt;&lt;/span&gt;
              &lt;/a&gt;
              &lt;ul class="dropdown-menu"&gt;
                  {% show_menu from_level to_level extra_inactive extra_active template "" "" child %}
              &lt;/ul&gt;
          {% else %}
              &lt;a href="{{ child.get_absolute_url }}"&gt;&lt;span&gt;{{ child.get_menu_title }}&lt;/span&gt;&lt;/a&gt;
          {% endif %}
      &lt;/li&gt;
      {% if class and forloop.last and not forloop.parentloop %}{% endif %}
  {% endfor %}
  </code></pre>