You are here

block--floating-social-icons.html.twig in Floating Social Icons 8

Default theme implementation to display a block.

Available variables:

  • plugin_id: The ID of the block implementation.
  • label: The configured label of the block if visible.
  • configuration: A list of the block's configuration values.
    • label: The configured label for the block.
    • label_display: The display settings for the label.
    • provider: The module or other provider that provided this block plugin.
    • Block plugin specific settings will also be stored here.
  • content: The content of this block.
  • attributes: array of HTML attributes populated by modules, intended to be added to the main container tag of this template.

    • id: A valid HTML ID and guaranteed unique.
  • title_attributes: Same as attributes, except applied to the main title tag that appears in the template.
  • title_prefix: Additional output populated by modules, intended to be displayed in front of the main title tag that appears in the template.
  • title_suffix: Additional output populated by modules, intended to be displayed after the main title tag that appears in the template.

File

templates/block--floating-social-icons.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation to display a block.
  5. *
  6. * Available variables:
  7. * - plugin_id: The ID of the block implementation.
  8. * - label: The configured label of the block if visible.
  9. * - configuration: A list of the block's configuration values.
  10. * - label: The configured label for the block.
  11. * - label_display: The display settings for the label.
  12. * - provider: The module or other provider that provided this block plugin.
  13. * - Block plugin specific settings will also be stored here.
  14. * - content: The content of this block.
  15. * - attributes: array of HTML attributes populated by modules, intended to
  16. * be added to the main container tag of this template.
  17. * - id: A valid HTML ID and guaranteed unique.
  18. * - title_attributes: Same as attributes, except applied to the main title
  19. * tag that appears in the template.
  20. * - title_prefix: Additional output populated by modules, intended to be
  21. * displayed in front of the main title tag that appears in the template.
  22. * - title_suffix: Additional output populated by modules, intended to be
  23. * displayed after the main title tag that appears in the template.
  24. *
  25. * @see template_preprocess_block()
  26. *
  27. * @ingroup themeable
  28. */
  29. #}
  30. {# Set main class and sub class based on values #}
  31. {% if social_values.icons == '1' %}
  32. {% set main_class = 'floating-top' %}
  33. {% elseif social_values.icons == '2' %}
  34. {% set main_class = 'floating-right' %}
  35. {% elseif social_values.icons == '3' %}
  36. {% set main_class = 'floating-bottom' %}
  37. {% elseif social_values.icons == '4' %}
  38. {% set main_class = 'floating-left' %}
  39. {% endif %}
  40. {% if social_values.icons is odd %}
  41. {% set sub_class = 'floating-horizontal' %}
  42. {% else %}
  43. {% set sub_class = 'floating-vertical' %}
  44. {% endif %}
  45. {# Set Responsive class #}
  46. {% if social_values.count == '2' %}
  47. {% set responsive_class = 'two' %}
  48. {% elseif social_values.count == '3' %}
  49. {% set responsive_class = 'three' %}
  50. {% elseif social_values.count == '4' %}
  51. {% set responsive_class = 'four' %}
  52. {% elseif social_values.count == '5' %}
  53. {% set responsive_class = 'five' %}
  54. {% elseif social_values.count == '6' %}
  55. {% set responsive_class = 'six' %}
  56. {% elseif social_values.count == '7' %}
  57. {% set responsive_class = 'seven' %}
  58. {% elseif social_values.count == '8' %}
  59. {% set responsive_class = 'eight' %}
  60. {% endif %}
  61. <div id="floating-icons">
  62. <div class="floating-social-icons {{ main_class }}">
  63. {% if social_values.facebook is not empty %}
  64. <div class="{{ sub_class }} {{ responsive_class }}">
  65. <a title="{{ social_titles.facebook_title }}" class="{{ social_values.hover }} facebook" href="{{ social_values.facebook }}" target="{{ social_values.target }}">
  66. <span class="fab fa-facebook-f"></span>
  67. </a>
  68. </div>
  69. {% endif %}
  70. {% if social_values.google_plus is not empty %}
  71. <div class="{{ sub_class }} {{ responsive_class }}">
  72. <a title="{{ social_titles.google_plus_title }}" class="{{ social_values.hover }} google-plus" href="{{ social_values.google_plus }}" target="{{ social_values.target }}">
  73. <span class="fab fa-google-plus-g"></span>
  74. </a>
  75. </div>
  76. {% endif %}
  77. {% if social_values.linkedIn is not empty %}
  78. <div class="{{ sub_class }} {{ responsive_class }}">
  79. <a title="{{ social_titles.linkedIn_title }}" class="{{ social_values.hover }} linkedin" href="{{ social_values.linkedIn }}" target="{{ social_values.target }}">
  80. <span class="fab fa-linkedin-in"></span>
  81. </a>
  82. </div>
  83. {% endif %}
  84. {% if social_values.twitter is not empty %}
  85. <div class="{{ sub_class }} {{ responsive_class }}">
  86. <a title="{{ social_titles.twitter_title }}" class="{{ social_values.hover }} twitter" href="{{ social_values.twitter }}" target="{{ social_values.target }}">
  87. <span class="fab fa-twitter"></span>
  88. </a>
  89. </div>
  90. {% endif %}
  91. {% if social_values.pinterest is not empty %}
  92. <div class="{{ sub_class }} {{ responsive_class }}">
  93. <a title="{{ social_titles.pinterest_title }}" class="{{ social_values.hover }} pinterest" href="{{ social_values.pinterest }}" target="{{ social_values.target }}">
  94. <span class="fab fa-pinterest"></span>
  95. </a>
  96. </div>
  97. {% endif %}
  98. {% if social_values.instagram is not empty %}
  99. <div class="{{ sub_class }} {{ responsive_class }}">
  100. <a title="{{ social_titles.instagram_title }}" class="{{ social_values.hover }} instagram" href="{{ social_values.instagram }}" target="{{ social_values.target }}">
  101. <span class="fab fa-instagram"></span>
  102. </a>
  103. </div>
  104. {% endif %}
  105. {% if social_values.mail is not empty %}
  106. <div class="{{ sub_class }} {{ responsive_class }}">
  107. <a title="{{ social_titles.mail_title }}" class="{{ social_values.hover }} mail" href="mailto:{{ social_values.mail }}" target="{{ social_values.target }}">
  108. <span class="fas fa-envelope"></span>
  109. </a>
  110. </div>
  111. {% endif %}
  112. {% if social_values.youtube is not empty %}
  113. <div class="{{ sub_class }} {{ responsive_class }}">
  114. <a title="{{ social_titles.youtube_title }}" class="{{ social_values.hover }} youtube" href="{{ social_values.youtube }}" target="{{ social_values.target }}">
  115. <span class="fab fa-youtube"></span>
  116. </a>
  117. </div>
  118. {% endif %}
  119. </div>
  120. </div>