quadstat_misc-8.x-1.x-dev/templates/social-share-link-pinterest.html.twig

templates/social-share-link-pinterest.html.twig
{#
/**
 * @file
 * Default theme implementation to display a social share link.
 *
 * Available variables:
 * - attributes: array of HTML attributes populated by modules, intended to
 *   be added to the main container tag of this template.
 * - pinterest_link_text: The sharing link text.
 * - title: The title of the shared item.
 * - url: The url to link to.
 * - image_url: The url of the image to use for sharing.
 *
 * See \Drupal\social_share\Plugin\SocialShareLink\PinterestShareLink() for a
 * a complete list of supported variables. Every context defind by the plugin
 * is made available as variable.
 *
 * @ingroup themeable
 */
#}

{{ attach_library('social_share/popup') }}

{% set url_params = {
  'url': url|default(url('<current>')|render|striptags),
  'description': title,
  'media': image_url,
  'hashtags': hashtags
}
%}
{% set attributes = attributes.
    setAttribute('target', '_blank').
    setAttribute('data-popup-height', '600').
    setAttribute('data-popup-width', '600').
    addClass('js-social-share-popup')
%}

<a href="https://www.pinterest.com/pin/create/button/?{{ url_params|url_encode }}" {{ attributes.addClass('social-share-pinterest') }}>
  {{ pinterest_link_text }}
</a>

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

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