ultimenu.html.twig in Ultimenu 8
Same filename and directory in other branches
Default theme implementation for Ultimenu block (the UL list or container). If you need to customize the actual Flyout, use region.html.twig instead.
Available variables:
- items: The renderable array containing the menu.
- attributes.class: A string containing the CSS classes for the SECTION tag:
- ultimenu ultimenu--ORIENTATION ultimenu--MENU-NAME SKIN-NAME.
- ultimenu ultimenu--horizontal ultimenu--htb ultimenu--main ultimenu--blue
The following variables are provided for contextual information.
- delta: (string) The ultimenu's block delta which is the cleaned menu name.
- config: An array of the block's configuration settings. Includes
- menu_name: main-menu
- skin: modules/custom/ultimenu/skins/ultimenu--htb-tabs-blue.css
- skin_name: ultimenu--htb-tabs-blue (based on safe CSS file name)
- orientation:
- ultimenu--htb: horizontal to bottom
- ultimenu--htt: horizontal to top
- ultimenu--vtr: vertical to right
- ultimenu--vtl: vertical to left
See also
1 theme call to ultimenu.html.twig
- UltimenuBlock::build in src/
Plugin/ Block/ UltimenuBlock.php - Builds and returns the renderable array for this block plugin.
File
templates/ultimenu.html.twigView source
- {#
- /**
- * @file
- * Default theme implementation for Ultimenu block (the UL list or container).
- * If you need to customize the actual Flyout, use region.html.twig instead.
- *
- * Available variables:
- * - items: The renderable array containing the menu.
- * - attributes.class: A string containing the CSS classes for the SECTION tag:
- * - ultimenu ultimenu--ORIENTATION ultimenu--MENU-NAME SKIN-NAME.
- * - ultimenu ultimenu--horizontal ultimenu--htb ultimenu--main ultimenu--blue
- *
- * The following variables are provided for contextual information.
- * - delta: (string) The ultimenu's block delta which is the cleaned menu name.
- * - config: An array of the block's configuration settings. Includes
- * - menu_name: main-menu
- * - skin: modules/custom/ultimenu/skins/ultimenu--htb-tabs-blue.css
- * - skin_name: ultimenu--htb-tabs-blue (based on safe CSS file name)
- * - orientation:
- * - ultimenu--htb: horizontal to bottom
- * - ultimenu--htt: horizontal to top
- * - ultimenu--vtr: vertical to right
- * - ultimenu--vtl: vertical to left
- *
- * @see template_preprocess_ultimenu()
- */
- #}
- {%
- set classes = [
- 'ultimenu',
- 'ultimenu--' ~ delta,
- config.orientation ? config.orientation|clean_class,
- 'v' in config.orientation ? 'ultimenu--vertical' : 'ultimenu--horizontal',
- config.skin_name ? config.skin_name|clean_class,
- ]
- %}
-
- {%
- set item_classes = [
- 'ultimenu__item',
- 'uitem',
- ]
- %}
- {% spaceless %}
- {% if items -%}
- <ul id="{{ attributes.id|clean_id }}"{{ attributes.addClass(classes)|without('id') }}>
- {%- for item in items -%}
- <li{{ item.attributes.addClass(item_classes, item.flyout ? 'has-ultimenu') }}>
- {%- if item.link -%}
- {{ item.link }}
- {%- endif -%}
- {%- if item.flyout -%}
- <section{{ item.flyout_attributes.addClass('ultimenu__flyout') }}>
- {{ item.flyout }}
- </section>
- {%- endif -%}
- </li>
- {%- endfor -%}
- </ul>
- {%- endif %}
- {% endspaceless %}