templates/areas/text-image/view.html.twig line 1

Open in your IDE?
  1. {% set headlineTag = pimcore_select('headlineTag', {
  2.     'store': [
  3.         ['none', 'none'],
  4.         ['h1', 'H1'],
  5.         ['h2', 'H2'],
  6.         ['h3', 'H3'],
  7.         ['h4', 'H4'],
  8.         ['h5', 'H5'],
  9.         ['h6', 'H6'],
  10.     ],
  11.     'defaultValue': '',
  12.     'reload': true
  13. }) %}
  14. {% if headlineTag.isEmpty() %}
  15.     {% do headlineTag.setDataFromResource('h2') %}
  16. {% endif %}
  17. {% set headline1 = headlineTag.data != 'none' ? headlineTag.data|raw : 'span'|raw %}
  18. {% set headline2 = headlineTag.data != 'none' ? '</' ~ headlineTag.data|raw ~ '>' : '</span>'|raw %}
  19. {% set backgroundColor = pimcore_select('backgorundColor', {
  20.     'store': [
  21.         ['dark', 'Dark'],
  22.         ['light', 'Light'],
  23.     ],
  24.     'defaultValue': '',
  25.     'reload': true
  26. }) %}
  27. {% if backgroundColor.isEmpty() %}
  28.     {% do backgroundColor.setDataFromResource('dark') %}
  29. {% endif %}
  30. {% if editmode %}
  31.     <div class="edit-box editmode">
  32.         <h1>KONFIGURATIONEN FÜR DEN AREABRICK:</h1>
  33.         <div class="flex gap-20">
  34.             <div class="content flex column gap-20">
  35.                 <div class="content-box flex gap-20">
  36.    
  37.                      <div class="item">
  38.                         <p class="edit-p">Titel-Typ definieren:</p>
  39.                         {{ headlineTag|raw }}
  40.                     </div>
  41.                     <div class="item">
  42.                         <p class="edit-p">Hintergrundfarbe definieren:</p>
  43.                         {{ backgroundColor|raw }}
  44.                     </div>
  45.                 </div>
  46.             </div>
  47.         </div>
  48.     </div>
  49. {% endif %}
  50. <section class="image-text text-image {{ backgroundColor.data }}">
  51.     <div class="text">
  52.         <div class="wrapper">
  53.             {% if editmode %}
  54.                 <h2 class="teaser-headline">
  55.                 {{ pimcore_textarea("headline",{
  56.                         "nl2br": true,
  57.                         "height": 100,
  58.                         "placeholder": "HAUPT ÜBERSCHRIFT FÜR DIESE AREA"
  59.                     }) }}
  60.                 </h2>
  61.             {% elseif not editmode and not pimcore_textarea('headline').isEmpty() %}
  62.                 <h2 class="teaser-headline">
  63.                     {{ pimcore_textarea('headline').getData() | nl2br }}
  64.                 </h2>
  65.             {% endif %}
  66.             {% if editmode %}
  67.                 {{ pimcore_wysiwyg('Content', {
  68.                     height: 150,
  69.                     customConfig: '/assets/js/editmode/config.js'
  70.                 }) }}
  71.             {% elseif not pimcore_wysiwyg('Content').isEmpty() %}
  72.                 {{ pimcore_wysiwyg('Content').getData() | raw }}
  73.             {% endif %}
  74.             {% if editmode %}
  75.                 <div style="margin-top: 30px;"></div>
  76.                 {{ pimcore_link('teaserLink', {'class': ""}) }}
  77.             {% elseif not editmode and not pimcore_link('teaserLink').isEmpty() %}
  78.                 <div class="btn secondary">
  79.                     {% if pimcore_link('left').getTarget() %}
  80.                         {% set target = pimcore_link('left').getTarget() %}
  81.                     {% else %}
  82.                         {% set target = '_self' %}
  83.                     {% endif %}
  84.                     <a class="flex" href="{{ pimcore_link('left').getHref() }}" target="{{ target }}">
  85.                         <span>{{ pimcore_link('teaserLink').getText() }}<svg width="15.708" height="10.709" viewBox="0 0 15.708 10.709">
  86.                                 <g transform="translate(0 0.354)">
  87.                                     <g transform="translate(0)">
  88.                                         <path class="line" d="M7.5,18h15" transform="translate(-7.5 -13)" fill="none" stroke="#fff" stroke-linejoin="round" stroke-width="1"/>
  89.                                         <path class="arrow" d="M18,7.5l5.026,5L18,17.5" transform="translate(-8.027 -7.5)" fill="none" stroke="#fff" stroke-width="1"/>
  90.                                     </g>
  91.                                 </g>
  92.                             </svg>
  93.                         </span>
  94.                     </a>
  95.                     <div class="button-shape">
  96.                         {{include('svg/button-shape.html.twig')}}
  97.                     </div>
  98.                 </div>
  99.             {% endif %}
  100.         </div>
  101.     </div>
  102.     <div class="image">
  103.         {% if not pimcore_relation("imageRelation").isEmpty() %}
  104.             {{ pimcore_relation("imageRelation").getElement().getThumbnail('ImageTextTeaser').html | raw }}
  105.         {% endif %}
  106.         {% if editmode %}
  107.             <div style="width: 400px; position: absolute; top: 0;">
  108.                 {{ pimcore_relation("imageRelation",{
  109.                     "types": ["asset"],
  110.                     "subtypes": {
  111.                         "asset": ["image"]
  112.                     }
  113.                 }) }}
  114.             </div>
  115.         {% endif %}
  116.     </div>
  117. </section>