templates/areas/apk-banner-text-action/view.html.twig line 1

Open in your IDE?
  1. {% if editmode %}
  2. <div class="uk-container apk-container-1400 uk-margin-medium">
  3.     <h2 class="uk-h2">Section banner + text + button</h2>
  4.     <ul uk-tab>
  5.         <li><a href="#">Configurations</a></li>
  6.         <li class="uk-active"><a href="#">Content Edit</a></li>
  7.     </ul>
  8.     <ul class="uk-switcher uk-margin">
  9.         <li>
  10.             <div>Type de heading pour le titre ?</div>
  11.             {{ pimcore_select("content-heading", {
  12.                 "store" : [
  13.                     ['span', 'span'],
  14.                     ['h1', 'Heading 1'],
  15.                     ['h2', 'Heading 2'],
  16.                     ['h3', 'Heading 3'],
  17.                     ['h4', 'Heading 4'],
  18.                     ['h5', 'Heading 5'],
  19.                     ['h6', 'Heading 6']
  20.                 ],
  21.                 "defaultValue" : "h2"
  22.             }) }}
  23.             <div><strong>Style</strong> du heading pour le titre ?</div>
  24.             {{ pimcore_select("content-heading-style", {
  25.                 "store" : [
  26.                     ['h1', 'Heading 1'],
  27.                     ['h2', 'Heading 2'],
  28.                     ['h3', 'Heading 3'],
  29.                     ['h4', 'Heading 4'],
  30.                     ['h5', 'Heading 5'],
  31.                     ['h6', 'Heading 6']
  32.                 ],
  33.                 "defaultValue" : "h2"
  34.             }) }}
  35.             
  36.             <div><strong>Position</strong> des textes</div>
  37.             {{ pimcore_select("text-position", {
  38.                 "store" : [
  39.                     ['uk-position-bottom-left', 'Bas gauche'],
  40.                     ['uk-position-bottom-center', 'Bas centrĂ©'],
  41.                     ['uk-position-bottom-right', 'Bas droit'],
  42.                     ['uk-position-center', 'CentrĂ© centrĂ©']
  43.                 ],
  44.                 "defaultValue" : "uk-position-bottom-left"
  45.             }) }}
  46.             <div>Couleur du texte</div>
  47.             {{ pimcore_select("text-color", {
  48.                 "store" : [
  49.                     ['uk-light', 'Blanc'],
  50.                     ['uk-dark', 'Noir'],
  51.                 ],
  52.                 "defaultValue" : "uk-light"
  53.             }) }}
  54.             <div>Couleur du bouton</div>
  55.             {{ pimcore_select("button-color", {
  56.                 "store" : [
  57.                     ['uk-button-black', 'Noir'],
  58.                     ['uk-button-white', 'Blanc'],
  59.                     ['', 'Orange']
  60.                 ],
  61.                 "defaultValue" : "uk-button-black"
  62.             }) }}
  63.             
  64.         </li>
  65.     
  66.         <li class="uk-active">
  67.             <div class="uk-margin-large-bottom">
  68.                 <div class="apk-content">
  69.                     <span class="uk-h4">Image en background (desktop)</span>
  70.                     {{ pimcore_image('bg-image') }}
  71.                     <span class="uk-h4">Image en background (mobile)</span>
  72.                     {{ pimcore_image('bg-image-mobile', {'width' : 600}) }}
  73.                     <h2 class="uk-h2">
  74.                         {{ pimcore_textarea("content-title",{
  75.                             "nl2br" : true,
  76.                             "placeholder" : "Titre (optionnel)"
  77.                         }) }}
  78.                     </h2>
  79.                     <div class="actions uk-margin-top">
  80.                         <span class="uk-h4">Lien (optionnel)</span>
  81.                         <div>
  82.                             {{ pimcore_link("content-btn", {
  83.                                 "class" : "uk-button"
  84.                             }) }}
  85.                         </div>
  86.                     </div>
  87.                 </div>
  88.             </div>
  89.         </li>
  90.     </ul>
  91. </div>
  92. {% else %}
  93. {% set buttonColor = pimcore_select("button-color").data %}
  94. {% set position = pimcore_select("text-position").data %}
  95. {% if position == "uk-position-bottom-left" %}
  96.     {% set alignment = "uk-text-left" %}
  97. {% elseif position == "uk-position-bottom-center" %}
  98.     {% set alignment = "uk-text-center" %}
  99. {% elseif position == "uk-position-bottom-right" %}
  100.     {% set alignment = "uk-text-right" %}
  101. {% endif %}
  102. <div class="apk-areabrick-container {{ pimcore_select("text-color") }}">
  103.     <div class="uk-container apk-container-1400">
  104.         <div class="apk-media">
  105.             {% set imgMobile = false %}
  106.             {% if not pimcore_image('bg-image-mobile').isEmpty %}
  107.                 {% set imgMobile = true %}
  108.             {% endif %}
  109.             
  110.             {% if pimcore_image('bg-image').src %}
  111.                 {{ pimcore_image('bg-image').thumbnail('background-image').html({'imgAttributes' : {'class' : (imgMobile ? 'image-desktop uk-visible@s' : '')}})|raw }}    
  112.             {% endif %}
  113.             
  114.             {% if imgMobile %}
  115.                 {% if pimcore_image('bg-image-mobile').src %}
  116.                     {{ pimcore_image('bg-image-mobile').thumbnail('background-image-mobile').html({'imgAttributes' : {'class' : 'image-mobile  uk-hidden@s'}})|raw }}    
  117.                 {% endif %}
  118.             {% endif %}
  119.             <div class="uk-height-1-1">
  120.                 <div class="uk-position-relative uk-height-1-1">
  121.                     <div class="apk-position {{ pimcore_select("text-position") }}">
  122.                         <div class="apk-content">
  123.                             {% if not pimcore_textarea("content-title").isEmpty %}
  124.                                 {% if pimcore_select("content-heading").getData() == 'span' %}
  125.                                     <span class="uk-h2">
  126.                                         {{ pimcore_textarea("content-title", {
  127.                                         "nl2br" : true})|raw }}
  128.                                     </span>
  129.                                 {% else %}
  130.                                     {% set content_heading = pimcore_select("content-heading").getData() %}
  131.                                     <{{ content_heading }} class="uk-{{ pimcore_select("content-heading-style").getData() }}">
  132.                                         {{ pimcore_textarea("content-title", {
  133.                                         "nl2br" : true})|raw }}
  134.                                     </{{ content_heading }}>
  135.                                 {% endif %}
  136.                             {% endif %}
  137.                             {% if not pimcore_link("content-btn").isEmpty() %}
  138.                                 <div class="apk-actions">
  139.                                     {{ pimcore_link("content-btn", {
  140.                                         "class" : "uk-button uk-button-large " ~ buttonColor
  141.                                     }) }}
  142.                                 </div>
  143.                             {% endif %}
  144.                         </div>
  145.                     </div>
  146.                 </div>
  147.             </div>
  148.         </div>
  149.     </div>
  150. </div>
  151. {% endif %}