templates/default/components/molecules/banner-teaser/banner-teaser.html.twig line 1

Open in your IDE?
  1. {% import 'macros/storyblok.html.twig' as storyblok %}
  2. {% set bannerTeaserContent %}
  3. <div class="banner-teaser__image {% if size|default %}banner-teaser__image--{{ size }}{% endif %}">
  4. {% if image is defined %}
  5. {% include('components/atoms/image/image.html.twig') with {
  6. 'src': image,
  7. 'class': 'image__src--cover',
  8. 'alt': title|default
  9. } %}
  10. {% endif %}
  11. </div>
  12. <div class="banner-teaser__head">
  13. {% if subtitle is defined and title is not empty %}
  14. <div class="banner-teaser__subtitle">
  15. {% include('components/atoms/headline/headline.html.twig') with {
  16. 'class': 'headline--inherit banner-teaser__subtitle-headline',
  17. 'headlineTag': 'div',
  18. 'styling': 'h1',
  19. 'text': subtitle,
  20. } %}
  21. </div>
  22. {% endif %}
  23. {% if title is defined and title is not empty %}
  24. <div class="banner-teaser__title">
  25. {% include('components/atoms/headline/headline.html.twig') with {
  26. 'class': 'headline--inherit headline--background headline--partly-underlined',
  27. 'headlineTag': 'div',
  28. 'styling': 'h1',
  29. 'text': title|markdown_to_html|striptags('<br><em>'),
  30. } %}
  31. </div>
  32. {% endif %}
  33. </div>
  34. {% endset %}
  35. <div class="banner-teaser">
  36. {% if link is iterable and link.cached_url is defined and link.cached_url is not empty %}
  37. <a href="{{ storyblok.storyblokLink(link)|spaceless }}" class="banner-teaser__content">
  38. {{ bannerTeaserContent }}
  39. </a>
  40. {% else %}
  41. <div class="banner-teaser__content">
  42. {{ bannerTeaserContent }}
  43. </div>
  44. {% endif %}
  45. {% if linkText is not empty %}
  46. <div class="banner-teaser__action">
  47. {% include 'components/atoms/text-link/text-link.html.twig'
  48. with {
  49. 'class': 'banner-teaser__link text-link--arrow-right',
  50. 'href': (link is iterable) ? storyblok.storyblokLink(link)|spaceless : '#',
  51. 'text': linkText
  52. } %}
  53. </div>
  54. {% endif %}
  55. </div>