bootstrap_italia-8.x-0.x-dev/components/components-0x/avatar/avatar.twig

components/components-0x/avatar/avatar.twig
{#
/**
 * @file
 * Template for Avatar component.
 * Docs: https://italia.github.io/bootstrap-italia/docs/componenti/avatar/
 * Latest revision: v2.6.1
 *
 * Available config:
 * - avatar_tag: div | a
 * - avatar_link: href | false
 * - a_tooltip: hash es: {data-toogle: 'tooltip', data-html: true, data-placement: 'left', title: '<strong>Anna
   Barbieri</strong><br /><em>Amministratore</em>'}
 * - avatar_type: primary | secondary | green | orange | red | false
 * - avatar_size: xs | sm | lg | xl | xxl
 * - avatar_img: link img | false
 * - avatar_icon: hash | false
 * - avatar_txt: string
 * - sr_only_alt: string
 *
#}
{% apply spaceless %}
  {% include '@bi-bcl/deprecated.html.twig' with {
    old: 'bootstrap_italia_components/avatar/avatar.twig',
    new: 'bi-bcl/avatar/avatar.html.twig',
  } %}

  {# Redirect to new component #}
  {% embed '@bi-bcl/avatar/avatar.html.twig' with {
    avatar_url: avatar_link,
    avatar_image: field_user_picture,
    avatar_text_color: avatar_type,
    avatar_size: avatar_size,
    avatar_attributes: a_tooltip
  } %}
    {% block avatarContent %}
      {% if avatar_icon %}
        {% include '@bi-bcl/icon/icon.html.twig' with {
          name: 'it-user',
          color: avatar_type ?? 'white',
        } %}
        <span class="visually-hidden">{{ sr_only_alt }}</span>
      {% endif %}

      {% if avatar_img %}
        <img src="{{ avatar_img }}" alt="{{ sr_only_alt }}">
      {% endif %}

      {% if avatar_txt %}
        <p aria-hidden="true">{{ avatar_txt }}</p>
        <span class="visually-hidden">{{ sr_only_alt }}</span>
      {% endif %}
    {% endblock %}
  {% endembed %}
{% endapply %}

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

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