bootstrap_theme_toggler-2.0.0/templates/block--toggler.html.twig

templates/block--toggler.html.twig
{# {{ kint() }} #}
{# {{ kint(data) }} #}
{# {{ theme_modes }} #}
{# {{ showcheck }} #}
{# {{ active_theme_path() }} #}
{# {{ basePath }} #}

{# 'basePath' should be root dir of toggler module #}
{# Get the active mode 'check mark' icon #}
{% if show_checkmark %}
  {# {% set checkmark = 'check' %} #}
  {% include basePath ~ '/svg/icon_check.svg' ignore missing %}
{% endif %}

{# Get the icons for the color modes #}
{% for theme in theme_modes %}
    {# {{ theme }} #}
    {% if theme and show_icons %}
      {% set svgpath = basePath ~ '/svg/icon_' ~ theme ~ '.svg' %}
      {# {{ svgpath }} #}
      {% include svgpath ignore missing %}
    {% endif %}
{% endfor %}


<div class="d-flex flex-row align-items-center gap-3">
  <div class="d-flex align-items-center dropdown">

    <button class="btn btn-link px-0 text-decoration-none dropdown-toggle d-flex align-items-center"
            id="bd-theme"
            type="button"
            aria-expanded="false"
            data-bs-toggle="dropdown"
            data-bs-display="static">
      {% if show_icons %}
        <svg class="bi my-1 me-2 theme-icon-active drupal-bootstrap-theme-toggler"><use href=""></use></svg>
      {% endif %}
      {% if show_toggler_label %}
        <span class="ms-2" id="bd-theme-text">{{ toggler_label }}</span>
      {% endif %}
    </button>

    <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="bd-theme" style="--bs-dropdown-min-width: 0rem;">

      {% for theme in theme_modes %}
          {# {{ theme }} #}
          {% if theme %}
            {# {{ theme }} #}
            <li>
              <button type="button" class="dropdown-item d-flex align-items-center" data-bs-theme-value={{ theme }}>
                {% if show_icons %}
                  <svg class="bi me-2 opacity-50 theme-icon drupal-bootstrap-theme-toggler"><use href={{ "#" ~ theme }}></use></svg>
                {% endif %}
                {% if show_option_labels %}
                  {{ theme }}
                {% endif %}
                {% if show_checkmark %}
                  <svg class="bi ms-auto d-none drupal-bootstrap-theme-toggler"><use href="#check"></use></svg>
                {% endif %}
              </button>
            </li>

          {% endif %}
      {% endfor %}

    </ul>
    
  </div>
</div>

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

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