{% if menu|length %}
    <nav class="{{ rootElementClass }}">
        {% if parentPageLink %}
            {% block parentPage %}
            <h2 class="{{ "parentPageName"|bemClass }}">{{ renderer.componentLink(parentPage, null, '' ~ "parentPageLink"|bemClass ) }}</h2>
            {% endblock %}
        {% elseif parentPage %}
            {% block parentPageName %}
            <h2 class="{{ "parentPageName"|bemClass }}">{{ parentPage.name }}</h2>
            {% endblock %}
        {% endif %}
        <ul class="{{ "menu"|bemClass }}">
            {% block menuItems %}
            {% for m in menu %}
                {{ m.preHtml|raw }}
                <li class="{{ m.class }}">
                    {% block menuLink %}
                    {{ renderer.componentLink(m.data, "#{linkPrefix}#{m.text}", '' ~ "link"|bemClass ) }}
                    {% endblock %}
                    {% if not m.last %}{{ separator }}{% endif %}
                    {% if subMenu is defined and m.current is defined and m.current %}
                        {{ renderer.component(subMenu) }}
                    {% endif %}
                </li>
                {{ m.postHtml|raw }}
            {% endfor %}
            {% endblock %}
        </ul>
    </nav>
{% endif %}

{% if menu|length %}
    <nav class="{{ rootElementClass }}">
        {% block content %}
        {% if parentPageLink %}
            {% block parentPage %}
            <h2 class="{{ "parentPageName"|bemClass }}">{{ renderer.componentLink(parentPage, null, '' ~ "parentPageLink"|bemClass ) }}</h2>
            {% endblock %}
        {% elseif parentPage %}
            {% block parentPageName %}
            <h2 class="{{ "parentPageName"|bemClass }}">{{ parentPage.name }}</h2>
            {% endblock %}
        {% endif %}
        <ul class="{{ "menu"|bemClass }}">
            {% block menuItems %}
            {% for m in menu %}
                {{ m.preHtml|raw }}
                <li class="{{ m.class }}">
                    {% block menuLink %}
                    {{ renderer.componentLink(m.data, "#{linkPrefix}#{m.text}", '' ~ "link"|bemClass ) }}
                    {% endblock %}
                    {% if not m.last %}{{ separator }}{% endif %}
                    {% if subMenu is defined and m.current is defined and m.current %}
                        {{ renderer.component(subMenu) }}
                    {% endif %}
                </li>
                {{ m.postHtml|raw }}
            {% endfor %}
            {% endblock %}
        </ul>
        {% endblock %}
    </nav>
{% endif %}

Add content block for easy overriding complete content
Add content block for easy overriding complete content
