templates/areas/wysiwyg-columns/view.html.twig line 1

Open in your IDE?
  1. <div class="container">
  2.     {% if editmode %}
  3.         <div class="row">
  4.             <div class="col-12">
  5.                 <div class="alert alert-primary p-3" role="alert">
  6.                     <div class="row g-3 align-items-center">
  7.                         <div class="col-auto">
  8.                             <div class="me-3 d-inline-block">
  9.                                 {{ "Aantal kolommen"|trans({}, 'admin') }}
  10.                                 {{ pimcore_select("colNumber", {
  11.                                     "store": [
  12.                                         ["1", "1"],
  13.                                         ["2", "2"],
  14.                                         ["3", "3"],
  15.                                         ["4", "4"],
  16.                                         ["6", "6"]
  17.                                     ],
  18.                                     "reload" : true,
  19.                                     "defaultValue" : "1",
  20.                                     "class" : "ms-3"
  21.                                 }) }}
  22.                             </div>
  23.                         </div>
  24.                         <div class="col-auto d-flex align-items-center">
  25.                             <div class="ms-3 d-inline-block">
  26.                                 {{ pimcore_checkbox('marginBottom', {
  27.                                     'reload' : false
  28.                                 }) }}
  29.                                 {{ 'Marge onderaan'|trans({}, 'admin') }}
  30.                             </div>
  31.                         </div>
  32.                         <div class="col-auto d-flex align-items-center">
  33.                             <div class="ms-3 d-inline-block">
  34.                                 {{ pimcore_checkbox('marginTop', {
  35.                                     'reload' : false
  36.                                 }) }}
  37.                                 {{ 'Marge bovenaan'|trans({}, 'admin') }}
  38.                             </div>
  39.                         </div>
  40.                     </div>
  41.                 </div>
  42.             </div>
  43.         </div>
  44.     {% endif %}
  45.     {# // Set Colwidth #}
  46.     {% set colNumber = pimcore_select("colNumber").getData() %}
  47.     {% if colNumber == 1 %}
  48.         {% set colWidth = 'col-12 col-lg-12' %}
  49.     {% elseif colNumber == 2 %}
  50.         {% set colWidth = 'col-12 col-lg-6' %}
  51.     {% elseif colNumber == 3 %}
  52.         {% set colWidth = 'col-12 col-lg-4' %}
  53.     {% elseif colNumber == 4 %}
  54.         {% set colWidth = 'col-6 col-lg-3' %}
  55.     {% elseif colNumber == 6 %}
  56.         {% set colWidth = 'col-6 col-lg-2' %}
  57.     {% else %}
  58.         {% set colWidth = 'col-6 col-lg-12' %}
  59.     {% endif %}
  60.     <div class="row {% if pimcore_checkbox('marginBottom').isChecked() %}mb-5{% endif %} {% if pimcore_checkbox('marginTop').isChecked() %}mt-5{% endif %} gy-3 gy-lg-0 justify-content-center">
  61.         {# // Make columns #}
  62.         {% for x in 1..colNumber %}
  63.             {% if editmode %}
  64.                 <div class="{{ colWidth }}">
  65.                     <div class="border border-1 border-black mb-3 p-3"
  66.                          style="background-color:{{ pimcore_input("colColor-"~x).getData() }}">
  67.                         {{ 'Achtergrondafbeelding'|trans({}, 'admin') }}
  68.                         {{ pimcore_image("bg-image-"~x, {
  69.                             "thumbnail" : "colThumb",
  70.                             "width" : 300,
  71.                             "height" : 300,
  72.                             "class" : "img-fluid"
  73.                         }) }}
  74.                         <div>
  75.                             {{ 'Shape'|trans({}, 'admin') }}
  76.                             {{ pimcore_checkbox("shape-"~x, {
  77.                                 "reload" : false,
  78.                                 "class" : 'd-inline-block p-1 w-100 border border-1 border-primary bg-white'
  79.                             }) }}
  80.                         </div>
  81.                         <div>
  82.                             {{ 'Background color'|trans({}, 'admin') }}
  83.                             {{ pimcore_input("colColor-"~x, {
  84.                                 "reload" : true,
  85.                                 "class" : 'd-inline-block p-1 w-100 border border-1 border-primary bg-white'
  86.                             }) }}
  87.                         </div>
  88.                         <div>
  89.                             {{ 'Hover color'|trans({}, 'admin') }}
  90.                             {{ pimcore_input("colHoverColor-"~x, {
  91.                                 "reload" : true,
  92.                                 "class" : 'd-inline-block p-1 w-100 border border-1 border-primary bg-white'
  93.                             }) }}
  94.                         </div>
  95.                         <div>
  96.                             {{ 'Link'|trans({}, 'admin') }}
  97.                             {{ pimcore_link("colLink-"~x) }}
  98.                         </div>
  99.                         <div>
  100.                             {{ 'Text'|trans({}, 'admin') }}
  101.                             {{ pimcore_wysiwyg("content-"~x, {
  102.                                 "height" : 200,
  103.                                 "customConfig" : "/static/ckeditor/ckeditor_config.js",
  104.                             }) }}</div>
  105.                     </div>
  106.                 </div>
  107.             {% endif %}
  108.             {% if not editmode %}
  109.                 <div class="{{ colWidth }}">
  110.                     <div class="area-col">
  111.                         <div class="area-col-inner position-relative {% if pimcore_checkbox("shape-"~x).isChecked() %}area-shape area-shape-default{% endif %}"
  112.                              style="background-color:{{ pimcore_input("colColor-"~x).getData() }};">
  113.                             {#
  114.                             {% if pimcore_link("colLink-"~x) %}
  115.                             <a href="{{ pimcore_link("colLink-"~x).getHref() }}" class="d-block h-100"
  116.                                target="{{ pimcore_link("colLink-"~x).getTarget() }}">
  117.                                 {% endif %}#}
  118.                             {% if editmode %}
  119.                                 <div class="d-block h-100">
  120.                                     {{ pimcore_image("bg-image-"~x, {
  121.                                         "thumbnail" : "colThumb",
  122.                                         "class" : "img-fluid"
  123.                                     }) }}
  124.                                 </div>
  125.                                 <img src="{{ pimcore_image("bg-image-"~x).getThumbnail("column-thumb") }}"
  126.                                      class="img-fluid">
  127.                             {% endif %}
  128.                             {% if not editmode and not pimcore_image("bg-image-"~x).isEmpty() %}
  129.                                 <div class="d-block h-100 w-100 area-col-inner-img position-absolute start-0 top-0">
  130.                                     <img src="{{ pimcore_image("bg-image-"~x).getThumbnail("column-thumb") }}"
  131.                                          class="">
  132.                                 </div>
  133.                             {% endif %}
  134.                             {#
  135.                             <div class="overlay"
  136.                                  style=" background-color:{{ pimcore_input("colHoverColor-"~x).getdata() }} ">
  137.                             </div>#}
  138.                             <div class="{#top-0 start-0 h-100 w-100#} d-flex align-items-center area-col-text p-5">
  139.                                 <div class="w-100">
  140.                                     {% if pimcore_link("colLink-"~x) %}
  141.                                         <h2 class="text-white m-0">{{ pimcore_link("colLink-"~x).getText() }}</h2>
  142.                                     {% endif %}
  143.                                     {{ pimcore_wysiwyg("content-"~x, {
  144.                                         "height" : 200
  145.                                     }) }}
  146.                                 </div>
  147.                             </div>
  148.                             {#
  149.                                                             {% if pimcore_link("colLink-"~x) %}
  150.                                                         </a>
  151.                                                         {% endif %}#}
  152.                         </div>
  153.                         {% if pimcore_checkbox("shape-"~x).isChecked() %}
  154.                             <svg height="100%" width="100%" xmlns="http://www.w3.org/2000/svg">
  155.                                 <clipPath clipPathUnits="objectBoundingBox" id="shapeyellow">
  156.                                     <path d="M0.536,0.991 s-0.414,0.038,-0.47,-0.038 C0.013,0.879,-0.009,0.825,0.004,0.696 s0.013,-0.268,0.013,-0.376 C0.018,0.133,0.026,0.017,0.269,0.006 C0.512,-0.005,0.731,-0.001,0.854,0.023 c0.121,0.023,0.14,0.05,0.143,0.241 c0.003,0.192,0.017,0.613,-0.062,0.688 c-0.054,0.051,-0.125,0.042,-0.399,0.038"></path>
  157.                                 </clipPath>
  158.                             </svg>
  159.                         {% endif %}
  160.                     </div>
  161.                 </div>
  162.             {% endif %}
  163.         {% endfor %}
  164.     </div>
  165. </div><!--end container-->