templates/Snippets/content-teaser.html.twig line 1

Open in your IDE?
  1. {% set orientation = app.request.get('orientation', 'square') %}
  2. {% if editmode %}
  3.     {{ include('Layout/includes/css.html.twig') }}
  4.     <div class="editmode-box editmode-box--info">
  5.         <div class="editmode-box__header">Settings</div>
  6.         {{ pimcore_image("teaser_image", {
  7.             thumbnail: 'content-teaser--' ~ orientation,
  8.             imgAttributes: {
  9.                 class: 'js-lazy-img embed-responsive-item teaser-animation__img'
  10.             },
  11.             lowQualityPlaceholder: true,
  12.         }) }}<br>
  13.         <label>Title: </label>
  14.         {{ pimcore_input('title') }}
  15.         <label>Subitle: </label>
  16.         {{ pimcore_input('subtitle') }}
  17.         <label>Badge: </label>
  18.         {{ pimcore_input('badgetext') }}
  19.         <label>Link: </label>
  20.         {{ pimcore_link('link') }}
  21.     </div>
  22. {% else %}
  23.     <section class="content-teaser content-teaser--{{ orientation }}  stretch-link teaser-animation">
  24.         <figure class="content-teaser__embed--{{ orientation }} embed-responsive mb-0">
  25.             {% if not pimcore_image('teaser_image').empty %}
  26.                 {% set description = getImageDescription(pimcore_image('teaser_image').image) %}
  27.                 {{ pimcore_image('teaser_image').image.thumbnail('content-teaser--' ~ orientation).html({
  28.                     imgAttributes: {
  29.                         class: 'js-lazy-img embed-responsive-item',
  30.                         title: description|default(''),
  31.                         alt: description|default(''),
  32.                     },
  33.                     lowQualityPlaceholder: false,
  34.                 })|raw }}
  35. {#                {% if description %}#}
  36. {#                    <figcaption class="content-teaser__caption">#}
  37. {#                        {{ description }}#}
  38. {#                    </figcaption>#}
  39. {#                {% endif %}#}
  40.             {% endif %}
  41.             {% do jsConfig().add('lazyImg', true) %}
  42.         </figure>
  43.         <div class="content-teaser__content">
  44.             <div>
  45.                 {% if not pimcore_input('badgetext').empty and not app.request.get('removeBadge', false) %}
  46.                     <div class="content-teaser__badge">
  47.                         {{ pimcore_input('badgetext').data }}
  48.                     </div>
  49.                 {% endif %}
  50.                 {% if not pimcore_input('subtitle').empty %}
  51.                     <div class="content-teaser__sub-title">
  52.                         {{ pimcore_input('subtitle').data }}
  53.                     </div>
  54.                 {% endif %}
  55.                 {% if not  pimcore_input('title').empty %}
  56.                     <h3 class="content-teaser__title h5">
  57.                         {% if pimcore_link('link').empty ? '' : pimcore_link('link').href|slice(0, 4)|lower == 'http' %}
  58.                             <a href="{{ pimcore_link('link').empty ? '' : pimcore_link('link').href }}"
  59.                                {% if not pimcore_link('link').empty and pimcore_link('link').target %}
  60.                                 target="{{ pimcore_link('link').target }}"
  61.                                 {% endif %}
  62.                                class="stretch-link__link" title="{{ description|default('') }}" data-event-tracking-category="LP Partnerteaser STT" data-event-tracking-action="{{ hostUrl() ~ getMainRequest().pathInfo() }}" data-event-tracking-label="{{ pimcore_link('link').empty ? '' : pimcore_link('link').href }}">
  63.                                 {{ pimcore_input('title').data }}
  64.                             </a>
  65.                         {% else %}
  66.                             <a href="{{ pimcore_link('link').empty ? '' : pimcore_link('link').href }}"
  67.                                {% if not pimcore_link('link').empty and pimcore_link('link').target %}
  68.                                 target="{{ pimcore_link('link').target }}"
  69.                                 {% endif %}
  70.                                class="stretch-link__link" title="{{ description|default('') }}">
  71.                                 {{ pimcore_input('title').data }}
  72.                             </a>
  73.                         {% endif %}
  74.                     </h3>
  75.                 {% endif %}
  76.             </div>
  77.         </div>
  78.     </section>
  79. {% endif %}