Skip to content

Instantly share code, notes, and snippets.

@thamas
Last active May 3, 2016 09:54
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 thamas/b3f336e7de6103c49246e6f71699053a to your computer and use it in GitHub Desktop.
Save thamas/b3f336e7de6103c49246e6f71699053a to your computer and use it in GitHub Desktop.
addClass
{{ menus.menu_links(items, attributes, 0, menu_name) }}
{% macro menu_links(items, attributes, menu_level, menu_name) %}
{% import _self as menus %}
{%
set menu_classes = [
'c-menu-' ~ menu_name|clean_class,
]
%}
{% if items %}
{% if menu_level == 0 %}
<ul{{ attributes.addClass(menu_classes) }}>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment