templates/includes/detailSnippet.html.twig line 1

Open in your IDE?
  1. {% extends 'layout/layout-snippet.html.twig' %}
  2. {% block content %}
  3.     <section class="snippet-wrapper">
  4.         <div class="snippet-container">
  5.             {# mobile close button #}
  6.             <a class="x-btn">
  7.                 <form>
  8.                     <input type="button" onclick="history.back()">
  9.                     <svg xmlns="http://www.w3.org/2000/svg" width="42" height="42" viewBox="0 0 42 42">
  10.                         <g transform="translate(-103.765 0.235)" style="isolation: isolate">
  11.                             <g transform="translate(103.765 -0.235)" fill="none" stroke="#000" stroke-width="2">
  12.                                 <rect width="42" height="42" rx="21" stroke="none"/>
  13.                                 <rect x="1" y="1" width="40" height="40" rx="20" fill="none"/>
  14.                             </g>
  15.                             <text transform="translate(124.765 28.765)" font-size="25" font-family="ZapfDingbatsITC, Zapf Dingbats"><tspan x="-9.528" y="0">✕</tspan></text>
  16.                         </g>
  17.                     </svg>
  18.                 </form>
  19.             </a>
  20.             {# title, text, back button #}
  21.             <div class="text">
  22.                 <div class="container">
  23.                     {% if editmode %}
  24.                         <h1>{{ pimcore_input('headline',{'placeholder':'Fachzeitschriften'}) }}</h1>
  25.                     {% elseif not editmode and not pimcore_input('headline').isEmpty() %}
  26.                         <h1>{{ pimcore_input('headline').getData() }}</h1>
  27.                     {% endif %}
  28.                     {% if editmode %}
  29.                         {{ pimcore_wysiwyg("snippetContent", {
  30.                             "height": 200,
  31.                             "toolbarGroups": [
  32.                                 {
  33.                                     "name": 'basicstyles',
  34.                                     "groups": [ 'basicstyles', 'list', "links"]
  35.                                 }
  36.                             ]}) }}
  37.                     {% elseif not editmode and not pimcore_wysiwyg("snippetContent").isEmpty() %}
  38.                         {{ pimcore_wysiwyg("snippetContent").getData() | raw }}
  39.                     {% endif %}
  40.                     {# back button #}
  41.                     <form>
  42.                         <a class="btn-snippet">
  43.                             <input type="button" onclick="history.back()">
  44.                             <svg xmlns="http://www.w3.org/2000/svg" width="215.129" height="49.2" viewBox="0 0 215.129 49.2">
  45.                                 <g id="Gruppe_138" transform="translate(312 -4274)" style="isolation: isolate">
  46.                                     <g id="Gruppe_84" transform="translate(-312 4274)" style="mix-blend-mode: screen;isolation: isolate">
  47.                                         <g id="Gruppe_85" style="mix-blend-mode: screen;isolation: isolate">
  48.                                             <g id="Pfad_37" fill="none">
  49.                                                 <path d="M25.1,0H190.031a24.853,24.853,0,0,1,25.1,24.6,24.853,24.853,0,0,1-25.1,24.6H25.1A24.853,24.853,0,0,1,0,24.6,24.853,24.853,0,0,1,25.1,0Z" stroke="none"/>
  50.                                                 <path d="M 25.09840393066406 2 C 21.97430419921875 2 18.94509887695312 2.599117279052734 16.09489440917969 3.780704498291016 C 13.34346008300781 4.921352386474609 10.87266540527344 6.554058074951172 8.7510986328125 8.633499145507812 C 6.632339477539062 10.71017837524414 4.969451904296875 13.12705993652344 3.80865478515625 15.81700134277344 C 2.6085205078125 18.59811782836914 1.999984741210938 21.55314826965332 1.999984741210938 24.60000038146973 C 1.999984741210938 27.64685249328613 2.6085205078125 30.60188293457031 3.80865478515625 33.38299942016602 C 4.969451904296875 36.07294082641602 6.632339477539062 38.48982238769531 8.7510986328125 40.56650161743164 C 10.87266540527344 42.64594268798828 13.34346008300781 44.27864837646484 16.09489440917969 45.41929626464844 C 18.94509887695312 46.60088348388672 21.97430419921875 47.20000076293945 25.09840393066406 47.20000076293945 L 190.0306396484375 47.20000076293945 C 193.1547241210938 47.20000076293945 196.1839294433594 46.60088348388672 199.0341339111328 45.41929626464844 C 201.7855682373047 44.27864837646484 204.2563629150391 42.64594268798828 206.3779296875 40.56650161743164 C 208.4966888427734 38.48982238769531 210.1595458984375 36.07294082641602 211.3203430175781 33.38299942016602 C 212.5204772949219 30.60188293457031 213.1290130615234 27.64685249328613 213.1290130615234 24.60000038146973 C 213.1290130615234 21.55314826965332 212.5204772949219 18.59811782836914 211.3203430175781 15.81700134277344 C 210.1595458984375 13.12705993652344 208.4966888427734 10.71017837524414 206.3779296875 8.633499145507812 C 204.2563629150391 6.554058074951172 201.7855682373047 4.921352386474609 199.0341339111328 3.780704498291016 C 196.1839294433594 2.599117279052734 193.1547241210938 2 190.0306396484375 2 L 25.09840393066406 2 M 25.09840393066406 0 L 190.0306396484375 0 C 203.8921051025391 0 215.1290130615234 11.0137939453125 215.1290130615234 24.60000038146973 C 215.1290130615234 38.18620681762695 203.8921051025391 49.20000076293945 190.0306396484375 49.20000076293945 L 25.09840393066406 49.20000076293945 C 11.23692321777344 49.20000076293945 -1.52587890625e-05 38.18620681762695 -1.52587890625e-05 24.60000038146973 C -1.52587890625e-05 11.0137939453125 11.23692321777344 0 25.09840393066406 0 Z" stroke="none" fill="#000"/>
  51.                                             </g>
  52.                                             <text id="_Zurück" transform="translate(101.801 33.201)" font-size="27" font-family="LucidaGrande, Lucida Grande"><tspan x="-60.818" y="0">←</tspan><tspan y="0" xml:space="preserve" font-family="MuseoSans-500, Museo Sans" font-weight="500"> Zurück</tspan></text>
  53.                                         </g>
  54.                                     </g>
  55.                                 </g>
  56.                             </svg>
  57.                         </a>
  58.                     </form>
  59.                 </div>
  60.             </div>
  61.             {# images or videos #}
  62.             {% if editmode %}
  63.                 {{ pimcore_relations("SnippetImages", {
  64.                     "types": ["object"],
  65.                     "title": "Magazin Objekte Ablegen",
  66.                     "subtypes": {
  67.                         "object": ["object"]
  68.                     },
  69.                     "classes": ["Magazin"]
  70.                 }) }}
  71.             {% elseif not editmode and not pimcore_relations("SnippetImages").isEmpty() %}
  72.                 <div class="images-container">
  73.                     <div class="images">
  74.                         {% for img in pimcore_relations("SnippetImages") %}
  75.                             {# Magazin objects #}
  76.                             <a {% if img.getModal() != "true" %} {% if img.getLink() %}href="{{ img.getLink().getHref() }}"{% endif %} target="{{ img.getLink().getTarget() }}" {% endif %}>
  77.                                 <div class="{% if img.video %}teaser-video{% else %}teaser{% endif %} {{ document.getProperty('Name') }}">
  78.                                     <div class="image-container">
  79.                                         {{ img.getImage().thumbnail('SnippetTeaser').html() | raw }}
  80.                                         {% if img.video %}
  81.                                             {{ include('svg/play.html.twig') }}
  82.                                         {% endif %}
  83.                                     </div>
  84.                                     {# modal #}
  85.                                     {% if img.getModal() == "true" %}
  86.                                         {# video or image #}
  87.                                         {% if img.video %}
  88.                                             <div class="modal-video">
  89.                                                 <svg xmlns="http://www.w3.org/2000/svg" width="42" height="42" viewBox="0 0 42 42">
  90.                                                     <g transform="translate(-103.765 0.235)" style="isolation: isolate">
  91.                                                         <g transform="translate(103.765 -0.235)" fill="none" stroke="#000" stroke-width="2">
  92.                                                             <rect width="42" height="42" rx="21" stroke="none"/>
  93.                                                             <rect x="1" y="1" width="40" height="40" rx="20" fill="none"/>
  94.                                                         </g>
  95.                                                         <text transform="translate(124.765 28.765)" font-size="25" font-family="ZapfDingbatsITC, Zapf Dingbats"><tspan x="-9.528" y="0">✕</tspan></text>
  96.                                                     </g>
  97.                                                 </svg>
  98.                                                 <div class="video">
  99.                                                     <video controls>
  100.                                                         <source src="{{ img.video }}">
  101.                                                     </video>
  102.                                                 </div>
  103.                                             </div>
  104.                                         {% else %}
  105.                                             <div class="modal-image">
  106.                                                 <svg xmlns="http://www.w3.org/2000/svg" width="42" height="42" viewBox="0 0 42 42">
  107.                                                     <g transform="translate(-103.765 0.235)" style="isolation: isolate">
  108.                                                         <g transform="translate(103.765 -0.235)" fill="none" stroke="#000" stroke-width="2">
  109.                                                             <rect width="42" height="42" rx="21" stroke="none"/>
  110.                                                             <rect x="1" y="1" width="40" height="40" rx="20" fill="none"/>
  111.                                                         </g>
  112.                                                         <text transform="translate(124.765 28.765)" font-size="25" font-family="ZapfDingbatsITC, Zapf Dingbats"><tspan x="-9.528" y="0">✕</tspan></text>
  113.                                                     </g>
  114.                                                 </svg>
  115.                                                 {{ img.getImage().thumbnail('ModalImage').html() | raw }}
  116.                                             </div>
  117.                                         {% endif %}
  118.                                     {% endif %}
  119.                                 </div>
  120.                             </a>
  121.                         {% endfor %}
  122.                     </div>
  123.                 </div>
  124.                 {# back button #}
  125.                 <form class="back-btn-form">
  126.                     <input type="button" onclick="history.back()">
  127.                     <svg xmlns="http://www.w3.org/2000/svg" width="215.129" height="49.2" viewBox="0 0 215.129 49.2">
  128.                         <g id="Gruppe_138" transform="translate(312 -4274)" style="isolation: isolate">
  129.                             <g id="Gruppe_84" transform="translate(-312 4274)" style="mix-blend-mode: screen;isolation: isolate">
  130.                                 <g id="Gruppe_85" style="mix-blend-mode: screen;isolation: isolate">
  131.                                     <g id="Pfad_37" fill="none">
  132.                                         <path d="M25.1,0H190.031a24.853,24.853,0,0,1,25.1,24.6,24.853,24.853,0,0,1-25.1,24.6H25.1A24.853,24.853,0,0,1,0,24.6,24.853,24.853,0,0,1,25.1,0Z" stroke="none"/>
  133.                                         <path d="M 25.09840393066406 2 C 21.97430419921875 2 18.94509887695312 2.599117279052734 16.09489440917969 3.780704498291016 C 13.34346008300781 4.921352386474609 10.87266540527344 6.554058074951172 8.7510986328125 8.633499145507812 C 6.632339477539062 10.71017837524414 4.969451904296875 13.12705993652344 3.80865478515625 15.81700134277344 C 2.6085205078125 18.59811782836914 1.999984741210938 21.55314826965332 1.999984741210938 24.60000038146973 C 1.999984741210938 27.64685249328613 2.6085205078125 30.60188293457031 3.80865478515625 33.38299942016602 C 4.969451904296875 36.07294082641602 6.632339477539062 38.48982238769531 8.7510986328125 40.56650161743164 C 10.87266540527344 42.64594268798828 13.34346008300781 44.27864837646484 16.09489440917969 45.41929626464844 C 18.94509887695312 46.60088348388672 21.97430419921875 47.20000076293945 25.09840393066406 47.20000076293945 L 190.0306396484375 47.20000076293945 C 193.1547241210938 47.20000076293945 196.1839294433594 46.60088348388672 199.0341339111328 45.41929626464844 C 201.7855682373047 44.27864837646484 204.2563629150391 42.64594268798828 206.3779296875 40.56650161743164 C 208.4966888427734 38.48982238769531 210.1595458984375 36.07294082641602 211.3203430175781 33.38299942016602 C 212.5204772949219 30.60188293457031 213.1290130615234 27.64685249328613 213.1290130615234 24.60000038146973 C 213.1290130615234 21.55314826965332 212.5204772949219 18.59811782836914 211.3203430175781 15.81700134277344 C 210.1595458984375 13.12705993652344 208.4966888427734 10.71017837524414 206.3779296875 8.633499145507812 C 204.2563629150391 6.554058074951172 201.7855682373047 4.921352386474609 199.0341339111328 3.780704498291016 C 196.1839294433594 2.599117279052734 193.1547241210938 2 190.0306396484375 2 L 25.09840393066406 2 M 25.09840393066406 0 L 190.0306396484375 0 C 203.8921051025391 0 215.1290130615234 11.0137939453125 215.1290130615234 24.60000038146973 C 215.1290130615234 38.18620681762695 203.8921051025391 49.20000076293945 190.0306396484375 49.20000076293945 L 25.09840393066406 49.20000076293945 C 11.23692321777344 49.20000076293945 -1.52587890625e-05 38.18620681762695 -1.52587890625e-05 24.60000038146973 C -1.52587890625e-05 11.0137939453125 11.23692321777344 0 25.09840393066406 0 Z" stroke="none" fill="#000"/>
  134.                                     </g>
  135.                                     <text id="_Zurück" transform="translate(101.801 33.201)" font-size="27" font-family="LucidaGrande, Lucida Grande"><tspan x="-60.818" y="0">←</tspan><tspan y="0" xml:space="preserve" font-family="MuseoSans-500, Museo Sans" font-weight="500"> Zurück</tspan></text>
  136.                                 </g>
  137.                             </g>
  138.                         </g>
  139.                     </svg>
  140.                 </form>
  141.             {% endif %}
  142.         </div>
  143.     </section>
  144.     <script src="/assets/js/snippet.js"></script>
  145.     
  146.     <style>
  147.         @media (min-width: 1440px) {
  148.             .snippet-wrapper .snippet-container .images {
  149.                 width: 100%;
  150.                 max-height: none;
  151.                 overflow-x: hidden;
  152.                 overflow-y: hidden;
  153.                 scrollbar-width: auto;
  154.             }
  155.         }
  156.         @media (min-width: 1440px) {
  157.             .snippet-wrapper .snippet-container .images-container {
  158.                 height: calc(100vh - 200px);
  159.                 max-height: none;
  160.                 overflow-x: auto;
  161.                 width: 60%;
  162.             }
  163.         }
  164.         @media (min-width: 992px) {
  165.            .snippet-wrapper .snippet-container .images a .teaser {
  166.                 width: calc(50% - 10px);
  167.                 max-width: none;
  168.                 max-height: none;
  169.             }
  170.         }
  171.         .snippet-wrapper .snippet-container .images a .teaser-video img {
  172.             object-fit: contain !important;
  173.             height: 100%;
  174.             width: 100%;
  175.             display: block;
  176.         }
  177.         .video {
  178.             height: 100%;
  179.             display: flex;
  180.             align-items: center;
  181.             justify-content: center;
  182.             margin-top: 20px;
  183.         }
  184.         @media (min-width: 992px) {
  185.             .video {
  186.                 margin-top: 0;
  187.             }
  188.         }
  189.         .video video {
  190.             height: 100%;
  191.             max-height: 80%;
  192.         }
  193.         .snippet-wrapper .snippet-container .images a .teaser-video .image-container {
  194.             position: relative;
  195.         }
  196.         .snippet-wrapper .snippet-container .images a .teaser-video .image-container svg {
  197.             position: absolute;
  198.             top: 50%;
  199.             left: 50%;
  200.             z-index: 1;
  201.             width: 80px;
  202.             height: auto;
  203.             transform: translate(-50%, -50%);
  204.         }
  205.         .snippet-wrapper .snippet-container .images a .teaser-video .image-container svg path {
  206.             fill: white;
  207.         }
  208.         .snippet-wrapper .snippet-container .images .modal-image {
  209.             z-index: 2;
  210.         }
  211.         .snippet-wrapper .snippet-container .images .modal-image.active {
  212.             display: block;
  213.             right: 0vw;
  214.             position: fixed;
  215.             top: 0;
  216.             height: calc(100vh);
  217.             width: calc(100vw - 15px);
  218.             padding: 10px;
  219.         }
  220.         .snippet-wrapper .snippet-container .images .modal-image.active svg {
  221.             top: 3%;
  222.         }
  223.         .snippet-wrapper .snippet-container .images .modal-video.active svg {
  224.             top: 3%;
  225.             position: absolute;
  226.             right: 50%;
  227.             transform: translateX(50%);
  228.             cursor: pointer;
  229.         }
  230.         .snippet-wrapper .snippet-container .images a .teaser-video {
  231.             height: fit-content;
  232.             cursor: pointer;
  233.         }
  234.         @media (min-width: 992px) {
  235.             .snippet-wrapper .snippet-container .images a .teaser-video {
  236.                 width: calc(33% - 12px);
  237.                 max-width: none;
  238.                 max-height: none;
  239.             }
  240.         }
  241.         .snippet-wrapper .snippet-container .images .modal-video {
  242.             z-index: 2;
  243.         }
  244.         .snippet-wrapper .snippet-container .images .modal-video {
  245.             position: absolute;
  246.             top: 5%;
  247.             width: 99vw;
  248.             height: 95vh;
  249.             background-color: #F7F6F5;
  250.             display: none;
  251.         }
  252.         @media (min-width: 1440px) {
  253.             .snippet-wrapper .snippet-container .images .modal-video {
  254.                 right: 0vw;
  255.             }
  256.         }
  257.         .snippet-wrapper .snippet-container .images .modal-video.active {
  258.             display: block;
  259.             right: 0vw;
  260.             position: fixed;
  261.             top: 0;
  262.             height: 100vh;
  263.             width: 100vw;
  264.             padding: 10px;
  265.         }
  266.     </style>
  267. {% endblock %}