social_auth_modal-1.x-dev/templates/block--social-auth-login-modal-block.html.twig

templates/block--social-auth-login-modal-block.html.twig
{% extends "block.html.twig" %}
{#
/**
 * @file
 * Default theme implementation for a Social Auth Block for Modal Login.
 *
 * Available variables:
 * - social_networks: An array of social networks which contains raw network data.
 *    - name: Social network name.
 *    - url: Authintication URL.
 *    - img_path: Path to social network logo.
 * - destination: The destination parameter for authintication URL.
 * - base_path: The base URL path of the Drupal installation. Will usually be
 *   "/" unless you have installed Drupal in a sub-directory.
 * - logged_in: Flag for authenticated user status. Will be true when the
 *   current user is a logged-in member.
 * - user: User account object.
 * - content: Render array of block content.
 */
#}

{% block content %}
  {% if social_networks %}
    {# Output content array without actual content for applying attachments. #}
    {{ content|without('links') }}
    {# Attaching default Social auth icon library. #}
    {{ attach_library('social_auth/auth-icons') }}

    {# Creating markup from raw data for being able to use images for links. #}
    {% for social_network in social_networks %}
      {% set image_attributes = create_attribute({
        'src': base_path ~ social_network.img_path,
        'alt': 'Authenticate through @social_network_name'|t({ '@social_network_name': social_network.name }),
        'width': 48,
        'height': 48,
        'loading': 'lazy'
      }) %}

      <a class="social-auth auth-link social-auth-modal__link" href="{{ social_network.url.toString() }}">
        <img{{ image_attributes.addClass('social-auth', 'auth-icon') }}>
      </a>
    {% endfor %}
  {% endif %}
{% endblock %}

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

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