links--bootstrap-language-block.html.twig in Bootstrap Languages 8
Default theme implementation for a set of links.
Available variables:
- attributes: Attributes for the UL containing the list of links.
- links: Links to be output.
Each link will have the following elements:
- title: The link text.
- url: The link URL. If omitted, the 'title' is shown as a plain text item in the links list. If 'url' is supplied, the entire link is passed to l() as its $options parameter.
- attributes: (optional) HTML attributes for the anchor, or for the <span> tag if no 'url' is supplied.
- languages: languages to be output.
1 theme call to links--bootstrap-language-block.html.twig
- BootstrapLanguagesBlock::build in src/
Plugin/ Block/ BootstrapLanguagesBlock.php - Builds and returns the renderable array for this block plugin.
File
templates/links--bootstrap-language-block.html.twigView source
- {#
- /**
- * @file
- * Default theme implementation for a set of links.
- *
- * Available variables:
- * - attributes: Attributes for the UL containing the list of links.
- * - links: Links to be output.
- * Each link will have the following elements:
- * - title: The link text.
- * - url: The link URL. If omitted, the 'title' is shown as a plain text
- * item in the links list. If 'url' is supplied, the entire link is passed
- * to l() as its $options parameter.
- * - attributes: (optional) HTML attributes for the anchor, or for the <span>
- * tag if no 'url' is supplied.
- * - languages: languages to be output.
- *
- * @see template_preprocess_links()
- * @see bootstrap_languages_preprocess_links__bootstrap_language_block()
- *
- * @ingroup themeable
- */
- #}
- {% if languages -%}
- <div{{ attributes.addClass('btn-group') }}>
- <button class="btn btn-default btn-sm dropdown-toggle" type="button" data-toggle="dropdown" aria-expanded="false">
- <span class="lang-sm" lang="{{ current_language }}"></span>
- <span class="caret"></span>
- </button>
- <ul class="dropdown-menu" role="menu">
- {%- for key, url in languages -%}
- <li>
- <a href="{{ url.toString }}">
- <span class="lang-sm lang-lbl" lang="{{ key }}"></span>
- </a>
- </li>
- {%- endfor -%}
- </ul>
- </div>
- {%- endif %}