Skip to content

Instantly share code, notes, and snippets.

@mortendk
Created April 12, 2014 15:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mortendk/10541297 to your computer and use it in GitHub Desktop.
Save mortendk/10541297 to your computer and use it in GitHub Desktop.
drupal8 menu dummy idea
{# level one
menu--level.html.twog
#}
{% if menu_level = 1 %}
<nav class="menu menu-{{ menu-name}}">
{% endif %}
<ul class="level-{{ menu_level }}">
{% for item in items %}
{% if item.link.active_trail %}
<li class="active-trail">{{ item.link }}</li>
{% else %}
<li>
<a href="{{ item.url }}" class="" {{ attributes }}>{{ item.link }}</a>
{% if level== 1%}
{% include menu-level :with item.children, menu_level+1 %}
{% elseif level ==2 % }
{% include menu-level-epic :with item.children, menu_level+2 %}
{% %}
</li>
{% endif %}
{# item.children calls the menu--level--1.html.twig #}
{{ item.children }}
</li>
{% endfor %}
</ul>
{% if menu_level = 1 %}
</nav>
{% endif %}
{# menu-level-epic .html.twig #}
{#
menu--level--1.html.twog
#}
<ul class="level-{{ menu_level }}">
{% for item in items %}
{% if item.link.active_trail %}
<li class="active-trail">{{ item.link }}</li>
{% else %}
<li>{{ item.link }}</li>
{% endif %}
{# item.children calls the menu--level--1.html.twig #}
{{ item.children }}
</li>
{% endfor %}
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment