src/Package/Openform/Front/Templates/Exhibition/item.html.twig line 1

Open in your IDE?
  1. {% extends "@openform_front_templates/base.html.twig" %}
  2. {% block bodyAttr %}data-page="detail-page"{% endblock %}
  3. {% block contentClass %}{{entity.menuVariant is defined and entity.menuVariant ? 'header-mak' : ''}}{% endblock %}
  4. {% set pageSubTitle = entity.Translation[app.request.locale].title %}
  5. {% set metaTitle = entity.Translation[app.request.locale].metaTitle ? entity.Translation[app.request.locale].metaTitle : entity.Translation[app.request.locale].title %}
  6. {% set metaDescription = entity.Translation[app.request.locale].metaDescription %}
  7. {% set metaKeywords = entity.Translation[app.request.locale].metaKeywords %}
  8. {% set pageImage = entity.imagePath ? openform_front_util.getImagePathByType(entity.Thumb,'list') : '' %}
  9. {% block header %}
  10.     {% include "@openform_front_templates/_includes/_header_mak.html.twig" with {'langLinks' : (langLinks is defined ? langLinks), item : entity}  %}
  11. {% endblock %}
  12. {% block content %}
  13.     {% set mobile = openform_front_util.isMobileDevice() %}
  14.     {% if mobile %}
  15.         {% if rootParent.isExhibition is defined %}
  16.             {% set href = toolkit_route_localizer.generate('exhibition_item', { 'slug': rootParent.Translation[app.request.locale].slug}, app.request.locale) %}    
  17.         {% elseif rootParent.isMak is defined %}
  18.             {% set href = toolkit_route_localizer.generate('mak_item', {'makSlug': rootParent.getMakSlug(app.request.locale), 'slug': rootParent.Translation[app.request.locale].slug}, app.request.locale)  %}    
  19.         {% endif %}
  20.         {% if href is defined %}
  21.             
  22.             <a href="{{href}}" class="index-news__title--mobile-mak">{{rootParent.Translation[app.request.locale].titleHtml|raw}}</a>
  23.         {% endif %}
  24.     {% endif %}
  25.     {% if isDepartment == false %}
  26.         {% include "@openform_front_templates/_blocks_sections/block.html.twig" with { sections: openform_front_util.getSections(entity)|length > 0 ? openform_front_util.getSections(entity)|slice(0, 1) : '' } %}
  27.     {% endif %}
  28.     <section class="index-news">
  29.         <div class="index-news__wrapper index-news__wrapper--exh js-list-data container">
  30.             {# {% if isDepartment %} #}
  31.                 <h1 class="index-news__title index-news__title--mak">{{ entity.Translation[app.request.locale].titleHtml|raw }}</h1>
  32.                 {% if  (entity.Translation[app.request.locale].text is defined and entity.Translation[app.request.locale].text) or (openform_front_util.getImagePathByType(entity.Thumb ?? '', 'detail')) %}
  33.                 <div class="mak-block block-image block-image--position-left">
  34.                     <div class="block-image__container">
  35.                         <div class="block-image__text index-news__text-mak">
  36.                             {% if entity.Translation[app.request.locale].text is defined %}
  37.                                 <div class="block__text">{{ entity.Translation[app.request.locale].text|raw }}</div>
  38.                             {% endif %}
  39.                         </div>
  40.                         <div class="block-image__image">
  41.                             {% set img = openform_front_util.getImagePathByType(entity.Thumb ?? '', 'detail') %}
  42.                             {% if img %}
  43.                                 <img class="block-image__image__img" loading="lazy" src="{{ asset(img) }}" alt="{{ entity.Translation[app.request.locale].alt }}">
  44.                             {% endif %}
  45.                         </div>
  46.                     </div>
  47.                 </div>
  48.                 {% endif %}
  49.             {# {% endif %} #}
  50.             {% set departments = entity.getVisibleDepartments(app.request.locale) %}
  51.             {% set hideDepartments = true %}
  52.             {% for department in departments|filter(department => department.isSkipped == false and department.Parent) %}
  53.                 {% set hideDepartments = false %}
  54.             {% endfor %}
  55.             {% if entity.getVisibleDepartments(app.request.locale) is defined and entity.getVisibleDepartments(app.request.locale)|length > 0 and not hideDepartments %}
  56.                 {% if isDepartment %}
  57.                     <h1 class="index-news__title index-news__title--mak">{{ 'T_SUBDEPARTMENTS'|trans({}, 'openform_front', app.request.locale) }}</h1>
  58.                 {% else %}
  59.                     <h1 class="index-news__title index-news__title--mak">{{ 'T_DEPARTMENTS'|trans({}, 'openform_front', app.request.locale) }}</h1>
  60.                 {% endif %}
  61.             {% endif %}
  62.             
  63.             <div class="index-news__items js-result-content">
  64.                 {# listowanie działów nie-ukrytych #}
  65.                 {% for department in departments %}
  66.                     {% if department.isSkipped == false and department.Parent %}
  67.                         {% set departmentHref =  toolkit_route_localizer.generate('exhibition_department_item',{ 'slug' : department.Translation[app.request.locale].slug }, app.request.locale) %}
  68.                         {% set img = openform_front_util.getImagePathByType(department.Thumb ?? '', 'list') %}
  69.                         <a class="news-item news-item--mak" href="{{ departmentHref }}" aria-label="{{ 'T_READ_MORE'|trans({}, 'openform_front', app.request.locale) }} {{ department.Translation[app.request.locale].title }}">
  70.                             {% if img %}
  71.                                 <img class="news-item__image news-item__image--mak" loading="lazy" src="{{ asset(img) }}" alt="{{ department.Translation[app.request.locale].alt }}" />
  72.                             {% endif %}
  73.                             <div class="news-item__content">
  74.                                 <h2 class="news-item__title news-item__title--mak">{{ department.Translation[app.request.locale].titleHtml|raw }}</h2>
  75.                                 {#
  76.                                 <div class="news-item__date-wrapper">
  77.                                     <time class="news-item__date">
  78.                                         {{ department.publishDate|explodedDate(app.request.locale).D }}
  79.                                         {{ department.publishDate|explodedDate(app.request.locale).month }}
  80.                                         {{ department.publishDate|explodedDate(app.request.locale).y }}
  81.                                     </time>
  82.                                 </div>
  83.                                 #}
  84.                                 <p class="news-item__text news-item__text--mak">{{ department.Translation[app.request.locale].shortLead }}</p>
  85.                             </div>
  86.                         </a>
  87.                     {% endif %}
  88.                 {% endfor %}
  89.             </div>
  90.             {% if (entity.getVisibleRelictPacks is defined and entity.getVisibleRelictPacks(app.request.locale)|length > 0) %}
  91.                 <h1 class="{{ hideDepartments ? 'index-news__title index-news__title--mak' : 'index-news__title mak__title index-news__title--mak' }}">{{ 'T_COLLECTIONS'|trans({}, 'openform_front', app.request.locale) }}</h1>
  92.             {% endif %}
  93.             <div class="mak__items mak__items--small-gap js-result-content">
  94.                 {# listowanie kolekcji z działu aktualnego  #}
  95.                 {% if entity.getVisibleRelictPacks is defined %}
  96.                     {% set relictPacks = entity.getVisibleRelictPacks(app.request.locale) %}
  97.                     
  98.                     {% for relictPack in relictPacks %}
  99.                         {% set relictPackHref =  toolkit_route_localizer.generate('relict_pack_item', {'slug' : relictPack.Translation[app.request.locale].slug }, app.request.locale) %}
  100.                         
  101.                         {% set img = openform_front_util.getImagePathByType(relictPack.Thumb ?? '', 'list') %}
  102.                         
  103.                         <a class="news-item news-item--mak" href="{{ relictPackHref }}" aria-label="{{ 'T_READ_MORE'|trans({}, 'openform_front', app.request.locale) }} {{ relictPack.Translation[app.request.locale].title }}">
  104.                             {% if img %}
  105.                                 <img class="news-item__image news-item__image--mak" loading="lazy" src="{{ asset(img) }}" alt="{{ relictPack.Translation[app.request.locale].alt }}">
  106.                             {% endif %}
  107.                             <div class="news-item__content">
  108.                                 <h2 class="news-item__title news-item__title--mak">{{ relictPack.Translation[app.request.locale].titleHtml|raw }}</h2>  
  109.                                 {#
  110.                                 <div class="news-item__date-wrapper">
  111.                                     <time class="news-item__date">
  112.                                         {{ relictPack.publishDate|explodedDate(app.request.locale).D }}
  113.                                         {{ relictPack.publishDate|explodedDate(app.request.locale).month }}
  114.                                         {{ relictPack.publishDate|explodedDate(app.request.locale).y }}
  115.                                     </time>
  116.                                 </div>
  117.                                 #}
  118.                                 <p class="news-item__text news-item__text--mak">{{ relictPack.Translation[app.request.locale].shortLead }}</p>
  119.                             </div>
  120.                         </a>
  121.                     {% endfor  %}
  122.                 {% endif %}
  123.                 {# listowanie kolekcji z podrzędnych działów ukrytych  #}
  124.                 {% for key, department in departments %}
  125.                     {% if department.isSkipped == true %}
  126.                         {% set relictPacks = department.getVisibleRelictPacks(app.request.locale) %}
  127.                         {% if entity.getVisibleRelictPacks is defined and entity.getVisibleRelictPacks(app.request.locale)|length > 0 %}
  128.                             <h1 class="index-news__title mak__title index-news__title--mak">{{ 'T_COLLECTIONS'|trans({}, 'openform_front', app.request.locale) }}</h1>
  129.                         {% elseif not hideDepartments %}
  130.                             <h1 class="index-news__title mak__title index-news__title--mak">{{ 'T_COLLECTIONS'|trans({}, 'openform_front', app.request.locale) }}</h1>
  131.                         {% else %}
  132.                             <h1 class="{{ key == 0 ? 'index-news__title index-news__title--mak' : 'index-news__title mak__title index-news__title--mak' }}">{{ 'T_COLLECTIONS'|trans({}, 'openform_front', app.request.locale) }}</h1>
  133.                         {% endif %}
  134.                         {% for relictPack in department.RelictPack %}
  135.                             {% set relictPackHref =  toolkit_route_localizer.generate('relict_pack_item',{ 'slug' : relictPack.Translation[app.request.locale].slug }, app.request.locale) %}
  136.                             {% set img = openform_front_util.getImagePathByType(relictPack.Thumb ?? '','list') %}
  137.                             <a class="news-item news-item--mak" href="{{ relictPackHref }}" aria-label="{{ 'T_READ_MORE'|trans({}, 'openform_front', app.request.locale) }} {{ relictPack.Translation[app.request.locale].title }}">
  138.                                 {% if img %}
  139.                                     <img class="news-item__image news-item__image--mak" loading="lazy" src="{{asset(img)}}" alt="{{ relictPack.Translation[app.request.locale].alt }}">
  140.                                 {% endif %}
  141.                                 <div class="news-item__content">
  142.                                     <h2 class="news-item__title news-item__title--mak">{{ relictPack.Translation[app.request.locale].titleHtml|raw }}</h2>
  143.                                     {# 
  144.                                     <div class="news-item__date-wrapper">
  145.                                         <time class="news-item__date">
  146.                                             {{ relictPack.publishDate|explodedDate(app.request.locale).D }}
  147.                                             {{ relictPack.publishDate|explodedDate(app.request.locale).month }}
  148.                                             {{ relictPack.publishDate|explodedDate(app.request.locale).y }}
  149.                                         </time>
  150.                                     </div>
  151.                                     #}
  152.                                     <p class="news-item__text news-item__text--mak">{{ relictPack.Translation[app.request.locale].shortLead }}</p>
  153.                                 </div>
  154.                             </a>
  155.                         {% endfor  %}
  156.                     {% endif %}
  157.                 {% endfor %}
  158.             </div>
  159.         </div>
  160.     </section>
  161.     
  162.     {% if isDepartment %}
  163.         {% include "@openform_front_templates/_blocks_sections/block.html.twig" with { sections: openform_front_util.getSections(entity)|length > 0 ? openform_front_util.getSections(entity):''} %}
  164.     {% else %}
  165.         {% include "@openform_front_templates/_blocks_sections/block.html.twig" with { sections: openform_front_util.getSections(entity)|length > 0 ? openform_front_util.getSections(entity)|slice(1, openform_front_util.getSections(entity)|length) : '' } %}
  166.     {% endif %}
  167. {% endblock %}