templates/_snippets/block_with_buttons.html.twig line 1

Open in your IDE?
  1. {% set content = blockWithButtons %}
  2. {% set blockId = 'block-with-buttons-' ~ random() %}
  3. <section class="block-with-buttons" id="{{ blockId }}">
  4. <div class="content">{{ content.content|default('')|raw }}</div>
  5. {% if content.buttons is defined and content.buttons|length > 0 %}
  6. {% for button in content.buttons %}
  7. {% set button_classes = 'btn ' ~ button.style|default('') %}
  8. {% if button.isReverseColor == true %}
  9. {% set button_classes = button_classes ~ ' reverse_color' %}
  10. {% endif %}
  11. {# Ecriture du bouton #}
  12. {% if button.isInternalLink == true %}
  13. <sulu-link href="{{ button.internalLink|default('') }}" class="{{ button_classes }}">{{ button.text|default('') }}</sulu-link>
  14. {% else %}
  15. <a href="{{ button.externalLink|default('') }}" class="{{ button_classes }}" target="_blank" rel="nofollow">{{ button.text|default('') }}</a>
  16. {% endif %}
  17. {% endfor %}
  18. {% endif %}
  19. </section>