{% try %} {% set menu = gantry.menu.instance(particle) %} {% catch %}
{{ e.getMessage }}
{% endtry %} {% set inline_mc_style %} #{{ id }}-particle { margin: 0; padding: 0; } {% if particle.animation_mode == 'slide' and particle.menu_animation == 'offcanvas' %}.jl-offcanvas-page #g-header {z-index:2;}{% endif %} #g-navigation .moduletable { color: initial; text-align: initial; } {% if particle.offcanvas_minheight %} #{{id}}-particle .jl-navbar-toggle {min-height:{{particle.offcanvas_minheight}}px; } {% endif %} {% if particle.toggle_color %} #{{id}}-particle .jl-navbar-toggle {color:{{particle.toggle_color}}; } {% endif %} {% if particle.toggle_color_hover %} #{{id}}-particle .jl-navbar-toggle:focus,#{{id}}-particle .jl-navbar-toggle:hover {color:{{particle.toggle_color_hover}};} {% endif %} {% if particle.customize_bar_background %} #{{id}}-particle .jl-offcanvas-bar { background: {{particle.customize_bar_background}}; } {% endif %} #{{id}}-particle .jl-nav-default>li>a,#{{id}}-particle .jl-nav-primary>li>a,#{{id}}-particle .jl-nav-default .jl-nav-sub a,#{{id}}-particle .jl-nav-primary .jl-nav-sub a {color: {{particle.nav_color|default('#9b9b9b')|e}};} {% if particle.nav_style == 'primary' %} #{{id}}-particle .jl-nav-primary>li>a:focus,#{{id}}-particle .jl-nav-primary>li>a:hover,#{{id}}-particle .jl-nav-primary>li.jl-active>a,#{{id}}-particle .jl-nav-primary .jl-nav-sub a:focus,#{{id}}-particle .jl-nav-primary .jl-nav-sub a:hover {color: {{particle.nav_color_active|default('#219897')|e}};} {% else %} #{{id}}-particle .jl-nav-default>li>a:focus,#{{id}}-particle .jl-nav-default>li>a:hover,#{{id}}-particle .jl-nav-default>li.jl-active>a,#{{id}}-particle .jl-nav-default .jl-nav-sub a:focus,#{{id}}-particle .jl-nav-default .jl-nav-sub a:hover {color: {{particle.nav_color_active|default('#219897')|e}};} {% endif %} {% if particle.toggle_text_fontsize %} #{{ id }}-particle .jl-navbar-toggle { font-size: {{ particle.toggle_text_fontsize }}px; } {% endif %} {% endset %} {% do gantry.document.addInlineStyle(inline_mc_style, 0) %} {% if particle.icon %} {% else %}
{% endif %} {% if particle.menu_text %}{{particle.menu_text}}{% endif %}
{% if particle.menu_animation == 'offcanvas' %}
{% if particle.close_button %} {% endif %} {% else %}
{% if particle.close_button %} {% endif %}
{% if particle.modal_vertically %}
{% endif %} {% endif %}
{% macro getCustomWidth(item, menu, mode, dropdown_type) -%} {%- if (item.width|default('auto') != 'auto') and not (dropdown_type == 'fullwidth' and item.level > 1) -%} {%- if mode == 'item' %} style="position: relative;" {%- elseif mode == 'submenu' %} style="width:{{ item.width }};" data-g-item-width="{{ item.width }}" {%- endif %} {%- endif %} {%- endmacro %} {% macro displayParticle(item, context) %} {% set context = context|merge({ particle: item.options.particle }) %} {% set classes = item.options.block.class %} {% endmacro %} {% macro displayTitle(item) %} {% if not item.icon_only or not (item.image or item.icon) %} {{ item.title }} {% if item.subtitle %} {{ item.subtitle }} {% endif %} {% endif %} {% endmacro %} {% macro displayItem(item, menu, context, dropdown_type) %} {% import _self as self %} {% if item.type == 'particle' and not item.options.particle.enabled %} {% set enabled = 0 %} {% endif %} {% if item.visible and item.enabled and enabled|default(1) %} {% set title = item.icon_only or item.link_title ? ' title="' ~ item.link_title|default(item.title)|e ~ '"' %} {% set label = item.icon_only and (item.image or item.icon) ? ' aria-label="' ~ item.title|e ~'"' %} {% set active = menu.isActive(item) ? ' jl-active' %} {% set dropdown = item.level == 1 ? ' g-' ~ item.getDropdown() %} {% set parent = item.children ? ' jl-parent' %} {% set target = (item.target != '_self' or context.particle.forceTarget) ? ' target="' ~ item.target|e ~ '"' %} {% set rel = item.rel %} {% if item.target == '_blank' %} {% if 'noopener' not in rel %} {% set rel = rel ? rel ~ ' ' : rel %} {% set rel = rel ~ 'noopener' %} {% endif %} {% if 'noreferrer' not in rel %} {% set rel = rel ? rel ~ ' ' : rel %} {% set rel = rel ~ 'noreferrer' %} {% endif %} {% endif %} {% set listAttributes = item.attributes|attribute_array %} {% set linkAttributes = '' %} {% if item.link_attributes %} {% for attribute in item.link_attributes %} {% for key, value in attribute %} {% if key == 'rel' %} {% for hVal in value|split(' ') %} {% if hVal not in rel %} {% set rel = rel ? rel ~ ' ' : rel %} {% set rel = rel ~ hVal %} {% endif %} {% endfor %} {% else %} {% set linkAttributes = linkAttributes ~ ' ' ~ key|e ~ '="' ~ value|e('html_attr') ~ '"' %} {% endif %} {% endfor %} {% endfor %} {% endif %} {% set rel = rel ? ' rel="' ~ rel|e('html_attr') ~ '"' %} {% endif %} {% endmacro %} {% macro displayContainers(item, menu, context, dropdown_type) %} {% import _self as self %} {% set groups = item.getDropdown() == 'standard' ? [item] : item.groups %}
    {% for column, items in groups %} {{ self.displayItems(items, menu, context, dropdown_type) }} {% endfor %}
{% endmacro %} {% macro displayItems(items, menu, context, dropdown_type) %} {% import _self as self %} {% for item in items %} {% if item.level == 1 %} {% set dropdown_type = item.dropdown %} {% endif %} {{ self.displayItem(item, menu, context, dropdown_type) }} {% endfor %} {% endmacro %} {% macro displaySubmenu(item, menu, context, dropdown_type) %} {% import _self as self %} {% if not item.dropdown_hide %} {% set animation = context.gantry.config.get('styles.menu.animation')|default('g-fade') %} {% if ((item.groups|length == 1 and not dropdown_type == 'fullwidth') or dropdown_type == 'standard') or (item.width|default('auto') != 'auto' and dropdown_type == 'fullwidth')%} {% set dropdown_dir = 'g-dropdown-' ~ item.dropdown_dir|default('right') %} {% endif %} {{ self.displayContainers(item, menu, context, dropdown_type) }} {% endif %} {% endmacro %} {# Set Nav Style #} {% set nav_style = particle.nav_style ? 'jl-nav-primary' : 'jl-nav-default' %} {% import _self as macro %} {% if menu.root.count() %} {% endif %}
{% if particle.module_id %}
{{ gantry.platform.displayModule(particle.module_id, {'style': particle.chrome|default('gantry'), 'position': 'particle'})|raw }}
{% endif %} {% if particle.menu_animation == 'modal' %} {% if particle.modal_vertically %}
{% endif %}
{% endif %}