uswds_base-8.x-2.0-alpha1/templates/navigation/menu--footer_menu.html.twig

templates/navigation/menu--footer_menu.html.twig
{#
/**
 * @file
 * Override of system/menu.html.twig for the footer menu.
 */
#}
{% import _self as menus %}
{#
  We call a macro which calls itself to render the full tree.
  @see http://twig.sensiolabs.org/doc/tags/macro.html
#}
{{ menus.menu_links(items, 0, footer_style) }}

{% macro menu_links(items, menu_level, footer_style) %}
  {% import _self as menus %}
  {% if items %}
    {% if footer_style == 'usa-footer-big'  %}
      <div class="tablet:grid-col-12">
    {% elseif footer_style == 'usa-footer-small'  %}
        <div class="tablet:grid-col-8">
    {% endif %}
    {% if menu_level == 0  %}
              <nav class="usa-footer-nav">
    {% endif %}

    {% if menu_level == 0 and footer_style == 'usa-footer-big' %}
              <div class="grid-row grid-gap-4">
    {% endif %}

    {% if menu_level == 0 and footer_style != 'usa-footer-big' %}
      <ul class="add-list-reset grid-row grid-gap">
    {% elseif footer_style != 'big' %}
      <ul class="usa-unstyled-list">
    {% endif %}

    {% for item in items %}
      {% if menu_level == 0 and footer_style == 'usa-footer-big' %}
        <div class="mobile-lg:grid-col-6 desktop:grid-col-2">
          <section class="usa-footer-primary-content usa-footer-collapsible">
            <strong><a class="usa-footer-primary-link" href="{{ item.url }}">{{ item.title }}</a></strong>
            <ul class="usa-unstyled-list">
              {% if item.below %}
                {{ menus.menu_links(item.below, 1, footer_style) }}
              {% endif %}
            </ul>
          </section>
        </div>
      {% elseif footer_style == 'usa-footer-big' %}
        <li class="usa-footer-secondary-link">
          <a href="{{ item.url }}">{{ item.title }}</a>
        </li>
      {% elseif footer_style == 'usa-footer-medium' %}
        <li class="mobile-lg:grid-col-4 desktop:grid-col-2 usa-footer-primary-content">
          <a class="usa-footer-primary-link" href="{{ item.url }}">{{ item.title }}</a>
        </li>
      {% else %}
        <li class="mobile-lg:grid-col-6 desktop:grid-col-auto usa-footer-primary-content">
          <a class="usa-footer-primary-link" href="{{ item.url }}">{{ item.title }}</a>
        </li>
      {% endif %}
    {% endfor %}

    </ul>

    {% if menu_level == 0 and footer_style == 'usa-footer-big' %}
      </div>
    {% endif %}

    {% if menu_level == 0 %}
                </nav>
        </div>
    {% endif %}

  {% endif %}
{% endmacro %}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc