addtoany-standard.html.twig 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation to standard AddToAny buttons.
  5. *
  6. * Available variables:
  7. * - addtoany_html: HTML for AddToAny buttons.
  8. * - button_image: URL for universal button.
  9. * - button_setting: Setting of button.
  10. * - button_size: Size of buttons.
  11. * - universal_button_placement: Value of 'before' or 'after' to place button.
  12. * - link_url: Value of URL to share.
  13. * - link_title: Value of page title to share.
  14. *
  15. * @ingroup themeable
  16. */
  17. #}
  18. {# Remove whitespace between tags for even spacing between buttons. #}
  19. {% spaceless %}
  20. {% if button_setting != 'none' %}
  21. {% set universal_button %}
  22. <a class="a2a_dd addtoany_share" href="https://www.addtoany.com/share#url={{ link_url|url_encode }}&amp;title={{ link_title|url_encode }}">
  23. {% if button_image %}
  24. <img src="{{ button_image }}">
  25. {% endif %}
  26. </a>
  27. {% endset %}
  28. {% endif %}
  29. <span class="a2a_kit a2a_kit_size_{{ buttons_size }} addtoany_list" data-a2a-url="{{ link_url }}" data-a2a-title="{{ link_title }}">
  30. {% if universal_button_placement == 'before' %}
  31. {{ universal_button }}
  32. {% endif %}
  33. {% if addtoany_html %}
  34. {{ addtoany_html|raw }}
  35. {% endif %}
  36. {% if universal_button_placement == 'after' %}
  37. {{ universal_button }}
  38. {% endif %}
  39. </span>
  40. {% endspaceless %}