Skip to content

Instantly share code, notes, and snippets.

Mario Hernandez mariohernandez

Block or report user

Report or block mariohernandez

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View menu-good-markup.html
<nav class="main-menu">
<ul class="main-menu__list">
<li class="main-menu__item main-menu__item--level-0">
<a href="/" class="main-menu__link">About Us</a>
</li>
<li class="main-menu__item main-menu__item--level-0">
<a href="#" class="main-menu__link">Our Services</a>
<ul class="main-menu__submenu">
<li class="main-menu__item main-menu__item--level-1">
<a href="#" class="main-menu__link">Training</a>
View menu-plain.html
<ul>
<li>
<a href="#">Top level link</a>
</li>
<li>
<a href="#">Top level link</a>
<ul>
<li>
<a href="#">First submenu link</a>
<ul>
View menu-macro.html.twig
{% import _self as menus %}
{{ menus.main_menu(items, attributes, 0) }}
{% macro main_menu(items, attributes, menu_level) %}
{% import _self as menus %}
{% if items %}
{% if menu_level == 0 %}
<ul{{ attributes }}>
{% else %}
View main-menu.scss
.main-menu {
background: #424242;
height: 60px;
}
.main-menu__list {
align-items: center;
background-color: transparent;
display: flex;
height: 60px;
View _main-menu-macro.twig
{#
/**
* @file
* Theme override to display a menu.
*
* Available variables:
* - menu_name: The machine name of the menu.
* - items: A nested list of menu items. Each menu item contains:
* - attributes: HTML attributes for the menu item.
* - below: The menu item child items.
View main-menu.yml
items:
- title: 'Home'
url: '#'
menu_level: 0
- title: 'About Us'
url: '#'
menu_level: 0
below:
- title: 'Our Team'
url: '#'
View main-menu-include.twig
{%
set classes = [
'block',
'block-' ~ configuration.provider|clean_class,
'block-' ~ plugin_id|clean_class,
]
%}
{% set attributes = attributes.addClass(classes) %}
{% embed '@sixflags_theme/main-menu/main-menu.twig' with {
attributes: attributes,
View main-menu.twig
{% import _self as menus %}
{{ menus.main_menu(items, 0) }}
{% macro main_menu(items, menu_level) %}
{% import _self as menus %}
{% if items %}
{% if menu_level == 0 %}
<nav class="main-menu">
<ul class="main-menu__list">
View menu.html.twig
{% import _self as menus %}
{{ menus.menu_links(items, attributes, 0) }}
{% macro menu_links(items, attributes, menu_level) %}
{% import _self as menus %}
{% if items %}
{% if menu_level == 0 %}
<ul{{ attributes }}>
{% else %}
View twig-debug-mode-output.html
<!-- THEME DEBUG -->
<!-- THEME HOOK: 'menu__main' -->
<!-- FILE NAME SUGGESTIONS:
* menu--main.html.twig
x menu.html.twig
-->
<!-- BEGIN OUTPUT from 'core/themes/stable/templates/navigation/menu.html.twig' -->
You can’t perform that action at this time.