templates/areas/apk-wysiwyg-global/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"><strong>Section wysiwyg</strong></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 class="uk-grid-small uk-child-width-1-3@m" uk-grid>
  11.                 <div>
  12.                     <h3><strong>Grille et alignement</strong></h3>
  13.                     
  14.                     <div>
  15.                         <strong>Répartition</strong> de la grille Image/texte
  16.                         <br>
  17.                         {{ pimcore_select("content-grid-rules", {
  18.                             "store" : [
  19.                                 ['grid-type-0', '1/1 | 1/1'],
  20.                                 ['grid-type-1', '1/2 | 1/2'],
  21.                                 ['grid-type-2', '2/5 | 3/5'],
  22.                                 ['grid-type-3', '1/3 | 2/3'],
  23.                                 ['grid-type-4', '2/3 | 1/3'],
  24.                                 ['grid-type-5', 'auto | expand'],
  25.                                 ['grid-type-6', 'expand | auto'],
  26.                                 ['grid-type-7', '3/5 | 2/5'],
  27.                             ],
  28.                             "defaultValue" : "grid-type-1"
  29.                         }) }}
  30.                     </div>
  31.                     <div>
  32.                         <strong>Position</strong> de l'image et du texte
  33.                         <br>
  34.                         {{ pimcore_select("image-text-position", {
  35.                             "store" : [
  36.                                 ['img-left', 'Image à gauche / texte à droite'],
  37.                                 ['img-right', 'Image à droite / texte à gauche']
  38.                             ],
  39.                             "defaultValue" : "img-left"
  40.                         }) }}
  41.                     </div>
  42.                     <div>Largeur du container</div>
  43.                         {{ pimcore_select("container-width", {
  44.                             "store" : [
  45.                                 ['apk-container-800', '800px'],
  46.                                 ['apk-container-900', '900px'],
  47.                                 ['apk-container-1000', '1000px'],
  48.                                 ['apk-container-1200', '1200px'],
  49.                                 ['apk-container-1400', '1400px']
  50.                             ],
  51.                             "defaultValue" : "apk-container-1400"
  52.                         }) }}
  53.                     <div>Largeur du container de la video</div>
  54.                         {{ pimcore_select("video-width", {
  55.                             "store" : [
  56.                                 ['apk-container-800', '800px'],
  57.                                 ['apk-container-900', '900px'],
  58.                                 ['apk-container-1000', '1000px'],
  59.                                 ['apk-container-1200', '1200px'],
  60.                                 ['apk-container-1400', '1400px']
  61.                             ],
  62.                             "defaultValue" : "apk-container-1400"
  63.                         }) }}
  64.                 </div>
  65.                 <div>
  66.                     <h3><strong>Mise en page du texte</strong></h3>
  67.                     <div>
  68.                         <strong>Type</strong> de heading pour le titre ?
  69.                         <br>
  70.                         {{ pimcore_select("content-heading", {
  71.                             "store" : [
  72.                                 ['span', 'span'],
  73.                                 ['h1', 'Heading 1'],
  74.                                 ['h2', 'Heading 2'],
  75.                                 ['h3', 'Heading 3'],
  76.                                 ['h4', 'Heading 4'],
  77.                                 ['h5', 'Heading 5'],
  78.                                 ['h6', 'Heading 6']
  79.                             ],
  80.                             "defaultValue" : "h2"
  81.                         }) }}
  82.                     </div>
  83.                     <div>
  84.                         <strong>Style</strong> du heading pour le titre ?
  85.                         <br>
  86.                         {{ pimcore_select("content-heading-style", {
  87.                             "store" : [
  88.                                 ['h1', 'Heading 1'],
  89.                                 ['h2', 'Heading 2'],
  90.                                 ['h3', 'Heading 3'],
  91.                                 ['h4', 'Heading 4'],
  92.                                 ['h5', 'Heading 5'],
  93.                                 ['h6', 'Heading 6']
  94.                             ],
  95.                             "defaultValue" : "h2"
  96.                         }) }}
  97.                     </div>
  98.                     <div>
  99.                         <strong>Couleur</strong> du background global
  100.                         <br>
  101.                         {{ pimcore_select("bg-color-global", {
  102.                             "store" : [
  103.                                 ['white','blanc'],
  104.                                 ['black','noir']
  105.                             ],
  106.                             "defaultValue" : "blanc"
  107.                         }) }}
  108.                     </div>
  109.                     <div>
  110.                         <strong>Alignement</strong> du titre
  111.                         <br>
  112.                         {{ pimcore_select("title-align", {
  113.                             "store" : [
  114.                                 ['uk-text-left', 'Gauche'],
  115.                                 ['uk-text-center', 'Centré'],
  116.                                 ['uk-text-right', 'Droite']
  117.                             ],
  118.                             "defaultValue" : "uk-text-left"
  119.                         }) }}
  120.                     </div>
  121.                     <div>
  122.                         <strong>Bordure</strong> en dessus du titre ?
  123.                         <br>
  124.                         {{ pimcore_select("title-border", {
  125.                             "store" : [
  126.                                 ['', 'non'],
  127.                                 ['apk-border', 'oui']
  128.                             ],
  129.                             "defaultValue" : ""
  130.                         }) }}
  131.                     </div>
  132.                     <div>
  133.                         <strong>Alignement</strong> du texte
  134.                         <br>
  135.                         {{ pimcore_select("text-align", {
  136.                             "store" : [
  137.                                 ['uk-text-center', 'Centré'],
  138.                                 ['uk-text-left', 'Gauche'],
  139.                                 ['uk-text-right', 'Droite']
  140.                             ],
  141.                             "defaultValue" : "uk-text-left"
  142.                         }) }}
  143.                     </div>
  144.                     <div>
  145.                         <strong>Titre séparé</strong> du texte ?
  146.                         <br>
  147.                         {{ pimcore_select("text-separation", {
  148.                             "store" : [
  149.                                 ['separated', 'Oui'],
  150.                                 ['grouped', 'Non']
  151.                             ],
  152.                             "defaultValue" : "separated"
  153.                         }) }}
  154.                     </div>
  155.                     <div>
  156.                         <strong>Alignement</strong> du bouton
  157.                         <br>
  158.                         {{ pimcore_select("button-align", {
  159.                             "store" : [
  160.                                 ['uk-text-center', 'Centré'],
  161.                                 ['uk-text-left', 'Gauche'],
  162.                                 ['uk-text-right', 'Droite']
  163.                             ],
  164.                             "defaultValue" : "uk-text-center"
  165.                         }) }}
  166.                     </div>
  167.                 </div>
  168.             
  169.                 <div>
  170.                     <h3><strong>Gestion des espaces</strong></h3>
  171.                     <div>
  172.                         Espacement en <strong>haut</strong> du block
  173.                         <br>
  174.                         {{ pimcore_select("margin-top", {
  175.                             "store" : [
  176.                                 ['uk-padding-remove-top', 'Suppression du padding'],
  177.                                 ['', 'Aucun'],
  178.                                 ['uk-margin-small-top', 'Petit'],
  179.                                 ['uk-margin-medium-top', 'Moyen'],
  180.                                 ['uk-margin-large-top', 'Grand'],
  181.                                 ['uk-margin-xlarge-top', 'Très grand'],
  182.                             ],
  183.                             "defaultValue" : ""
  184.                         }) }}
  185.                     </div>
  186.                     <div>
  187.                         Espacement en <strong>bas</strong> du block
  188.                         <br>
  189.                         {{ pimcore_select("margin-bottom", {
  190.                             "store" : [
  191.                                 ['uk-padding-remove-bottom', 'Suppression du padding'],
  192.                                 ['', 'Aucun'],
  193.                                 ['uk-margin-small-bottom', 'Petit'],
  194.                                 ['uk-margin-medium-bottom', 'Moyen'],
  195.                                 ['uk-margin-large-bottom', 'Grand'],
  196.                                 ['uk-margin-xlarge-bottom', 'Très grand'],
  197.                             ],
  198.                             "defaultValue" : ""
  199.                         }) }}
  200.                     </div>
  201.                     <div>
  202.                         Espacement en <strong>haut</strong> du wysiwyg
  203.                         <br>
  204.                         {{ pimcore_select("margin-cotent-top", {
  205.                             "store" : [
  206.                                 ['', 'Aucun'],
  207.                                 ['uk-margin-small-top', 'Petit'],
  208.                                 ['uk-margin-medium-top', 'Moyen'],
  209.                                 ['uk-margin-large-top', 'Grand'],
  210.                                 ['uk-margin-xlarge-top', 'Très grand'],
  211.                             ],
  212.                             "defaultValue" : "uk-margin-medium-top"
  213.                         }) }}
  214.                     </div>
  215.                     <div>
  216.                         Espacement en <strong>bas</strong> du wysiwyg
  217.                         <br>
  218.                         {{ pimcore_select("margin-content-bottom", {
  219.                             "store" : [
  220.                                 ['', 'Aucun'],
  221.                                 ['uk-margin-small-bottom', 'Petit'],
  222.                                 ['uk-margin-medium-bottom', 'Moyen'],
  223.                                 ['uk-margin-large-bottom', 'Grand'],
  224.                                 ['uk-margin-xlarge-bottom', 'Très grand'],
  225.                             ],
  226.                             "defaultValue" : ""
  227.                         }) }}
  228.                     </div>
  229.                 </div>
  230.             </div>
  231.         </li>
  232.         {% endif %}
  233.             {% set imgTextPosition = pimcore_select("image-text-position").data %}
  234.             {% if imgTextPosition == 'img-left' %}
  235.                 {% set ImgTextPositionCode = 'uk-flex-first@m' %}
  236.             {% else %}
  237.                 {% set ImgTextPositionCode = '' %}
  238.             {% endif %}
  239.     
  240.             {% set content_grid_value = pimcore_select("content-grid-rules").getData() %}
  241.             {% if content_grid_value == 'grid-type-0' %}
  242.                 {% set grid_left_class = 'uk-width-1-1' %}
  243.                 {% set grid_right_class = 'uk-width-1-1' %}
  244.             {% elseif content_grid_value == 'grid-type-1' %}
  245.                 {% set grid_left_class = 'uk-width-1-2@m' %}
  246.                 {% set grid_right_class = 'uk-width-1-2@m' %}
  247.             {% elseif content_grid_value == 'grid-type-2' %}
  248.                 {% set grid_left_class = 'uk-width-1-2@s uk-width-2-5@m' %}
  249.                 {% set grid_right_class = 'uk-width-1-2@s uk-width-3-5@m' %}
  250.             {% elseif content_grid_value == 'grid-type-3' %}
  251.                 {% set grid_left_class = 'uk-width-1-2@s uk-width-1-3@m' %}
  252.                 {% set grid_right_class = 'uk-width-1-2@s uk-width-2-3@m' %}
  253.             {% elseif content_grid_value == 'grid-type-4' %}
  254.                 {% set grid_left_class = 'uk-width-1-2@s uk-width-2-3@m' %}
  255.                 {% set grid_right_class = 'uk-width-1-2@s uk-width-1-3@m' %}
  256.             {% elseif content_grid_value == 'grid-type-5' %}
  257.                 {% set grid_left_class = 'uk-width-1-2@s uk-width-auto@m' %}
  258.                 {% set grid_right_class = 'uk-width-1-2@s uk-width-expand@m' %}
  259.             {% elseif content_grid_value == 'grid-type-6' %}
  260.                 {% set grid_left_class = 'uk-width-1-2@s uk-width-expand@m' %}
  261.                 {% set grid_right_class = 'uk-width-1-2@s uk-width-auto@m' %}
  262.             {% elseif content_grid_value == 'grid-type-7' %}
  263.                 {% set grid_left_class = 'uk-width-1-2@s uk-width-3-5@m' %}
  264.                 {% set grid_right_class = 'uk-width-1-2@s uk-width-2-5@m' %}
  265.             {% endif %}
  266.         {% if editmode %}
  267.     
  268.         <li class="uk-active">
  269.             <div>
  270.                 {% if pimcore_select("text-separation").data == "separated" %}
  271.                     <div class="{{ pimcore_select("title-align").data }}">
  272.                         <span class="uk-h2">Titre</span>
  273.                         <h2 class="uk-h2">
  274.                             {{ pimcore_textarea("content-title",{
  275.                                 "nl2br" : true
  276.                             }) }}
  277.                         </h2>
  278.                     </div>
  279.                 {% endif %}
  280.                 <div class="uk-grid-large uk-margin-large-bottom" uk-grid>
  281.                     <div class="{{ grid_left_class }} apk-media">
  282.                         <span class="uk-h2">Image (optionnel)</span>
  283.                         {{ pimcore_image("content-figure") }}
  284.                         <hr>
  285.                         <span class="uk-h2">Vidéo (optionnel)</span>
  286.                         {{ pimcore_video('content-video', {
  287.                             width: 700,
  288.                             height: 400
  289.                         }) }}
  290.                         <span class="uk-h4">Image à afficher pour la vidéo</span>
  291.                         {{ pimcore_image("content-background-image") }}
  292.                         <div class="actions uk-margin-top">
  293.                             <span class="uk-h2">Lien (optionnel)</span>
  294.                             {{ pimcore_link("content-btn") }}
  295.                         </div>
  296.                     </div>
  297.                     <div class="{{ grid_right_class }} apk-content">
  298.                         {% if pimcore_select("text-separation").data != "separated" %}
  299.                         <div class="{{ pimcore_select("title-align").data }}">
  300.                             <h2 class="uk-h2">
  301.                                 <span class="uk-h2">Titre</span>
  302.                                 {{ pimcore_textarea("content-title",{
  303.                                     "nl2br" : true
  304.                                 }) }}
  305.                             </h2>
  306.                         </div>
  307.                         {% endif %}
  308.                         <span class="uk-h2">Texte</span>
  309.                         <div class="{{ pimcore_select("text-align").data }}">
  310.                             {{ pimcore_wysiwyg("content") }}
  311.                         </div>
  312.                     </div>
  313.                 </div>
  314.                 <span class="uk-h2">Texte sous contenu</span>
  315.                     <div class="{{ pimcore_select("text-align").data }}">
  316.                         {{ pimcore_wysiwyg("content-bottom") }}
  317.                     </div>
  318.             </div>
  319.         </li>
  320.     </ul>
  321. </div>
  322. {% endif %}
  323. {% if not editmode %}
  324.     {% if ( not pimcore_image("content-figure").isEmpty() ) or ( not pimcore_video("content-video").isEmpty() ) %}
  325.     <div class="apk-areabrick-container {{ pimcore_select("margin-top") }} {{ pimcore_select("margin-bottom") }} {{ pimcore_select("bg-color-global") }}">
  326.         <div class="uk-container {{ pimcore_select("container-width") }}">
  327.             {% if pimcore_select("text-separation").data == "separated" %}
  328.                 <div class="{{ pimcore_select("title-align") }} uk-margin-medium-bottom {{ pimcore_select("title-border")}}">
  329.                     {% if not pimcore_textarea("content-title").isEmpty %}
  330.                         {% if pimcore_select("content-heading").getData() == 'span' %}
  331.                             <span class="uk-h2">
  332.                                 {{ pimcore_textarea("content-title", {
  333.                                 "nl2br" : true})|raw }}
  334.                             </span>
  335.                         {% else %}
  336.                             {% set content_heading = pimcore_select("content-heading").getData() %}
  337.                             <{{ content_heading }} class="uk-{{ pimcore_select("content-heading-style").getData() }}">
  338.                                 {{ pimcore_textarea("content-title", {
  339.                                 "nl2br" : true})|raw }}
  340.                             </{{ content_heading }}>
  341.                         {% endif %}
  342.                     {% endif %}
  343.                 </div>
  344.             {% endif %}
  345.             <div class="uk-grid-large" uk-grid>
  346.                 <div class="{{ grid_right_class }}">
  347.                     <div>
  348.                         {% if pimcore_select("text-separation").data != "separated" %}
  349.                         <div class="{{ pimcore_select("title-align") }} uk-margin-medium-bottom {{ pimcore_select("title-border")}}">
  350.                             {% if not pimcore_textarea("content-title").isEmpty %}
  351.                                 {% if pimcore_select("content-heading").getData() == 'span' %}
  352.                                     <span class="uk-h2">
  353.                                         {{ pimcore_textarea("content-title", {
  354.                                         "nl2br" : true})|raw }}
  355.                                     </span>
  356.                                 {% else %}
  357.                                     {% set content_heading = pimcore_select("content-heading").getData() %}
  358.                                     <{{ content_heading }} class="uk-{{ pimcore_select("content-heading-style").getData() }}">
  359.                                         {{ pimcore_textarea("content-title", {
  360.                                         "nl2br" : true})|raw }}
  361.                                     </{{ content_heading }}>
  362.                                 {% endif %}
  363.                             {% endif %}
  364.                         </div>
  365.                         {% endif %}
  366.                         <div class="{{ pimcore_select("text-align") }} uk-container apk-wysiwyg-content-link">
  367.                             {{ pimcore_wysiwyg("content") }}
  368.                         </div>
  369.                         <div class="{{ pimcore_select("button-align").data }}">
  370.                             {{ pimcore_link("content-btn", {"class" : "uk-button"}) }}
  371.                         </div>
  372.                     </div>
  373.                 </div>
  374.                 {% if not pimcore_video("content-video").isEmpty() %}
  375.                     <div class="{{ grid_left_class }} {{ ImgTextPositionCode }} apk-media uk-text-center">
  376.                         <div>
  377.                             {% if pimcore_link("content-btn").href %}
  378.                                 <a href="{{ pimcore_link("content-btn").href }}" target="{{ pimcore_link("content-btn").target }}">
  379.                             {% endif %}
  380.                             {% if not pimcore_video("content-video").isEmpty() %}
  381.                                 {% if pimcore_image("content-background-image").src() %}
  382.                                 <div class="uk-container {{ pimcore_select("video-width") }}">
  383.                                     <div data-caption="{{ pimcore_image('content-background-image').getAlt() }}" class="uk-height-1-1" uk-toggle="target: #modal-media-youtube;">
  384.                                         <figure class="uk-dark uk-position-relative uk-height-1-1" style="background: url('{{ pimcore_image("content-background-image").thumbnail('global-image') }}') 50% 50% / cover">
  385.                                             
  386.                                             <img src="{{ pimcore_image("content-background-image").getThumbnail('global-image') }}" class="" alt=""/>
  387.                                             
  388.                                             <div class="uk-overlay-primary uk-position-cover">
  389.                                                 <div class="uk-position-center">
  390.                                                     <svg width="80" height="80" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" data-svg="play-circle"><polygon fill="none" stroke="currentColor" stroke-width="1.1" points="8.5 7 13.5 10 8.5 13"></polygon><circle fill="none" stroke="currentColor" stroke-width="1.1" cx="10" cy="10" r="9"></circle></svg>
  391.                                                 </div>
  392.                                             </div>
  393.                                         </figure>
  394.                                     </div>
  395.                                     <div id="modal-media-youtube" class="uk-flex-top" uk-modal>
  396.                                         <div class="uk-modal-dialog uk-margin-auto-vertical">
  397.                                         
  398.                                             <button class="uk-modal-close-outside" type="button" uk-close></button>
  399.                                             
  400.                                             {{ pimcore_video("content-video", { 
  401.                                                 width : 1920,
  402.                                                 height: 1080
  403.                                             }) }}
  404.                                                     
  405.                                         </div>
  406.                                     </div>
  407.                                 </div>
  408.                                 {% else %}
  409.                                 <div class="uk-container {{ pimcore_select("video-width") }}">
  410.                                     <div class="uk-position-relative apk-video">
  411.                                         <div class="aspect-ratio">
  412.                                             {{ pimcore_video('content-video') }}
  413.                                         </div>
  414.                                     </div>
  415.                                 </div>
  416.                                     
  417.                                 {% endif %}
  418.                             {% else %}
  419.                                 {{ pimcore_image("content-figure").thumbnail("global-image").html()|raw }}
  420.                             {% endif %}
  421.                             
  422.                             {% if pimcore_link("content-btn").href %}
  423.                                 </a>
  424.                             {% endif %}
  425.                         </div>
  426.                     </div>
  427.                 {% endif %}
  428.             </div>
  429.             <div class="{{ pimcore_select("text-align").data }} {{ pimcore_select("margin-content-bottom") }} {{ pimcore_select("margin-content-top") }}">
  430.                 {{ pimcore_wysiwyg("content-bottom") }}
  431.             </div>
  432.         </div>   
  433.     </div>
  434.     {% else %}
  435.     <div class="apk-areabrick-container {{ pimcore_select("margin-top") }} {{ pimcore_select("margin-bottom") }} {{ pimcore_select("bg-color-global") }}">
  436.         <div class="uk-container {{ pimcore_select("container-width") }}">
  437.             {% if pimcore_select("text-separation").data == "separated" %}
  438.                 <div class="uk-grid-large" uk-grid>
  439.                     <div class="{{ grid_right_class }}">
  440.                         <div class="{{ pimcore_select("title-align") }} {{ pimcore_select("title-border")}}">
  441.                             {% if not pimcore_textarea("content-title").isEmpty %}
  442.                                 {% if pimcore_select("content-heading").getData() == 'span' %}
  443.                                     <span class="uk-h2">
  444.                                         {{ pimcore_textarea("content-title", {
  445.                                         "nl2br" : true})|raw }}
  446.                                     </span>
  447.                                 {% else %}
  448.                                     {% set content_heading = pimcore_select("content-heading").getData() %}
  449.                                     <{{ content_heading }} class="uk-{{ pimcore_select("content-heading-style").getData() }}">
  450.                                         {{ pimcore_textarea("content-title", {
  451.                                         "nl2br" : true})|raw }}
  452.                                     </{{ content_heading }}>
  453.                                 {% endif %}
  454.                             {% endif %}
  455.                         </div>
  456.                     </div>
  457.                     <div class="{{ grid_left_class }} {{ ImgTextPositionCode }} {{ pimcore_select("text-align") }}">
  458.                         {{ pimcore_wysiwyg("content") }}
  459.                         <div class="{{ pimcore_select("button-align").data }}">
  460.                             {{ pimcore_link("content-btn", {"class" : "uk-button"}) }}
  461.                         </div>
  462.                     </div>
  463.                 </div>
  464.             {% else %}
  465.             <div>
  466.                 <div class="{{ pimcore_select("title-align") }} {{ pimcore_select("title-border")}}">
  467.                     {% if not pimcore_textarea("content-title").isEmpty %}
  468.                         {% if pimcore_select("content-heading").getData() == 'span' %}
  469.                             <span class="uk-h2">
  470.                                 {{ pimcore_textarea("content-title", {
  471.                                 "nl2br" : true})|raw }}
  472.                             </span>
  473.                         {% else %}
  474.                             {% set content_heading = pimcore_select("content-heading").getData() %}
  475.                             <{{ content_heading }} class="uk-{{ pimcore_select("content-heading-style").getData() }}">
  476.                                 {{ pimcore_textarea("content-title", {
  477.                                 "nl2br" : true})|raw }}
  478.                             </{{ content_heading }}>
  479.                         {% endif %}
  480.                     {% endif %}
  481.                 </div>
  482.                 <div class="{{ pimcore_select("text-align") }} uk-container apk-wysiwyg-content-link">
  483.                     {{ pimcore_wysiwyg("content") }}
  484.                     <div class="{{ pimcore_select("button-align").data }}">
  485.                         {{ pimcore_link("content-btn", {"class" : "uk-button "}) }}
  486.                     </div>
  487.                 </div>
  488.             </div>
  489.             {% endif %}
  490.             <div class="{{ pimcore_select("text-align").data }} {{ pimcore_select("margin-content-bottom") }} {{ pimcore_select("margin-content-top") }}">
  491.                 {{ pimcore_wysiwyg("content-bottom") }}
  492.             </div>
  493.           
  494.         </div>   
  495.     </div>
  496.     {% endif %}
  497. {% endif %}