superfish-menu-items.html.twig in Superfish 8
Default theme implementation of Superfish menu items.
Available variables:
- html_id: Unique menu item identifier.
- item_class: Menu item classes.
- link: Link element.
- link_menuparent: Link element, when a menu parent.
- children: Menu item children.
- multicolumn_wrapper: Whether the menu item contains a column.
- multicolumn_column: Whether the menu item contains a column.
- multicolumn_content: Whether the menu item contains a column.
See also
2 theme calls to superfish-menu-items.html.twig
- template_preprocess_superfish in ./
superfish.theme.inc - Prepares variables for the Superfish menu template.
- template_preprocess_superfish_menu_items in ./
superfish.theme.inc - Prepares variables for Superfish menu items templates.
File
templates/superfish-menu-items.html.twigView source
- {#
- /**
- * @file
- * Default theme implementation of Superfish menu items.
- *
- * Available variables:
- * - html_id: Unique menu item identifier.
- * - item_class: Menu item classes.
- * - link: Link element.
- * - link_menuparent: Link element, when a menu parent.
- * - children: Menu item children.
- * - multicolumn_wrapper: Whether the menu item contains a column.
- * - multicolumn_column: Whether the menu item contains a column.
- * - multicolumn_content: Whether the menu item contains a column.
- *
- * @see template_preprocess_superfish_menu_items()
- *
- * @ingroup themeable
- */
- #}
-
- {% set classes = [] %}
- {% spaceless %}
- {% for item in menu_items %}
-
- {% if item.children is not empty %}
- {% set item_class = item.item_class ~ ' menuparent' %}
- {% if item.multicolumn_column %}
- {% set item_class = item_class ~ ' sf-multicolumn-column' %}
- {% endif %}
- {% endif %}
-
- <li{{ item.attributes }}>
- {% if item.multicolumn_column %}
- <div class="sf-multicolumn-column">
- {% endif %}
- {% if item.children is not empty %}
- {{ item.link_menuparent }}
- {% else %}
- {{ item.link }}
- {% endif %}
- {% if item.multicolumn_wrapper %}<ul class="sf-multicolumn">
- <li class="sf-multicolumn-wrapper {{ item.item_class }}">
- {% endif %}
- {% if item.children is not empty %}
- {% if item.multicolumn_content %}<ol>{% else %}<ul>{% endif %}
- {{ item.children }}
- {% if item.multicolumn_content %}</ol>{% else %}</ul>{% endif %}
- {% endif %}
- {% if item.multicolumn_wrapper %}</li></ul>{% endif %}
- {% if item.multicolumn_column %}</div>{% endif %}
- </li>
-
- {% endfor %}
- {% endspaceless %}