src/Package/Openform/Front/Templates/Mak/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 index-news__wrapper--museum js-list-data container">
  30.             {# ! if entity.isSkipped #}
  31.             {% if isDepartment %}
  32.                 <h1 class="index-news__title index-news__title--mak">{{ entity.Translation[app.request.locale].titleHtml|raw }}</h1>
  33.                 {% if  (entity.Translation[app.request.locale].text is defined and entity.Translation[app.request.locale].text) or (openform_front_util.getImagePathByType(entity.Thumb ?? '', 'detail')) %}
  34.                 <div class="mak-block block-image block-image--position-left">
  35.                     <div class="block-image__container">
  36.                         <div class="block-image__text index-news__text-mak">
  37.                             {% if entity.Translation[app.request.locale].text is defined %}
  38.                                 <div class="block__text">{{ entity.Translation[app.request.locale].text|raw }}</div>
  39.                             {% endif %}
  40.                         </div>
  41.                         <div class="block-image__image">
  42.                             {% set img = openform_front_util.getImagePathByType(entity.Thumb ?? '', 'detail') %}
  43.                             {% if img %}
  44.                                 <img class="block-image__image__img" loading="lazy" src="{{ asset(img) }}" alt="{{ entity.Translation[app.request.locale].alt }}">
  45.                             {% endif %}
  46.                         </div>
  47.                     </div>
  48.                 </div>
  49.                 {% endif %}
  50.             {% endif %}
  51.             {% set departments = entity.getVisibleDepartments(app.request.locale) %}
  52.             {% set hideDepartments = true %}
  53.             {% for department in departments|filter(department => department.isSkipped == false and department.Parent) %}
  54.                 {% set hideDepartments = false %}
  55.             {% endfor %}
  56.             {% set skipDepartments = false %}
  57.             {% for key, department in departments %}
  58.                     {% if department.isSkipped == true and department.AntiqueSuit|length > 0 %}
  59.                         {% set skipDepartments = true %}
  60.                         
  61.                     {% endif %}
  62.             {% endfor %}
  63.             {% if entity.getVisibleDepartments(app.request.locale) is defined and entity.getVisibleDepartments(app.request.locale)|length > 0 and not hideDepartments %}
  64.                 {% if isDepartment %}
  65.                     <h1 class="index-news__title index-news__title--mak">{{ 'T_SUBDEPARTMENTS'|trans({}, 'openform_front', app.request.locale) }}</h1>
  66.                 {% else %}
  67.                     <h1 class="index-news__title index-news__title--mak">{{ 'T_DEPARTMENTS'|trans({}, 'openform_front', app.request.locale) }}</h1>
  68.                 {% endif %}
  69.             {% endif %}
  70.             <div class="index-news__items js-result-content">
  71.                 {# listowanie działów nie-ukrytych #}
  72.                 {% for department in departments %}
  73.                     {% if department.isSkipped == false  %}
  74.                         {% set departmentHref =  toolkit_route_localizer.generate('mak_department_item', {'makSlug' : parentPage.Translation[app.request.locale].slug, 'slug' : department.Translation[app.request.locale].slug}, app.request.locale) %}
  75.                         {% set img = openform_front_util.getImagePathByType(department.Thumb ?? '','list') %}
  76.                         <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 }}">
  77.                             {% if img %}
  78.                                 <img class="news-item__image news-item__image--mak" loading="lazy" src="{{ asset(img) }}" alt="{{ department.Translation[app.request.locale].alt }}">
  79.                             {% endif %}
  80.                             <div class="news-item__content">
  81.                                 <h2 class="news-item__title news-item__title--mak">{{ department.Translation[app.request.locale].titleHtml|raw }}</h2>
  82.                                 {#
  83.                                 <div class="news-item__date-wrapper">
  84.                                     <time class="news-item__date">
  85.                                         {{ department.publishDate|explodedDate(app.request.locale).D }}
  86.                                         {{ department.publishDate|explodedDate(app.request.locale).month }}
  87.                                         {{ department.publishDate|explodedDate(app.request.locale).y }}
  88.                                     </time>
  89.                                 </div>
  90.                                 #}
  91.                                 <p class="news-item__text news-item__text--mak">{{ department.Translation[app.request.locale].shortLead }}</p>
  92.                             </div>
  93.                         </a>
  94.                     {% endif %}
  95.                 {% endfor %}
  96.             </div>
  97.             {% if entity.getVisibleAntiqueSuits is defined and entity.getVisibleAntiqueSuits(app.request.locale)|length > 0 or skipDepartments %}
  98.             {# or skipDepartments #}
  99.                 <h2 class="index-news__title index-news__title--mak mak__title">{{ 'T_COLLECTIONS'|trans({}, 'openform_front', app.request.locale) }}</h2>
  100.             {% elseif not hideDepartments %}
  101.                 {# <h2 class="index-news__title mak__title mak__title index-news__title--mak">{{ 'T_COLLECTIONS'|trans({}, 'openform_front', app.request.locale) }}</h2> #}
  102.             {% else %}
  103.                 {# <h2 class="{{ 'index-news__title index-news__title--mak' }}">{{ 'T_COLLECTIONS'|trans({}, 'openform_front', app.request.locale) }}</h2> #}
  104.             {% endif %}    
  105.             <div class="mak__items mak__items--small-gap js-result-content">
  106.                 {# listowanie kolekcji z działu aktualnego #}
  107.                 {% if entity.getVisibleAntiqueSuits is defined %}
  108.                     {% set antiqueSuits = entity.getVisibleAntiqueSuits(app.request.locale) %}
  109.                     {% for antiqueSuit in antiqueSuits %}
  110.                         {% set antiqueSuitHref =  toolkit_route_localizer.generate('antique_suit_item', {'slug' : antiqueSuit.Translation[app.request.locale].slug}, app.request.locale) %}
  111.                         {% set img = openform_front_util.getImagePathByType(antiqueSuit.Thumb ?? '', 'list') %}
  112.                         <a class="news-item news-item--mak" href="{{ antiqueSuitHref }}" aria-label="{{ 'T_READ_MORE'|trans({}, 'openform_front', app.request.locale) }} {{ antiqueSuit.Translation[app.request.locale].title }}">
  113.                             {% if img %}
  114.                                 <img class="news-item__image news-item__image--mak" loading="lazy" src="{{ asset(img) }}" alt="{{ antiqueSuit.Translation[app.request.locale].alt }}">
  115.                             {% endif %}
  116.                             <div class="news-item__content">
  117.                                 <h2 class="news-item__title news-item__title--mak">{{ antiqueSuit.Translation[app.request.locale].titleHtml|raw }}</h2>
  118.                                 {#
  119.                                 <div class="news-item__date-wrapper">
  120.                                     <time class="news-item__date">
  121.                                         {{ antiqueSuit.publishDate|explodedDate(app.request.locale).D }}
  122.                                         {{ antiqueSuit.publishDate|explodedDate(app.request.locale).month }}
  123.                                         {{ antiqueSuit.publishDate|explodedDate(app.request.locale).y }}
  124.                                     </time>
  125.                                 </div>
  126.                                 #}
  127.                                 <p class="news-item__text news-item__text--mak">{{ antiqueSuit.Translation[app.request.locale].shortLead }}</p>
  128.                             </div>
  129.                         </a>
  130.                     {% endfor %}
  131.                 {% endif %}
  132.                 {# listowanie kolekcji z podrzędnych działów ukrytych #}
  133.                 
  134.                 {% for key, department in departments %}
  135.                     {% if department.isSkipped == true %}
  136.                         
  137.                         
  138.                         {% set antiqueSuits = department.getVisibleAntiqueSuits(app.request.locale) %}
  139.                         {% for antiqueSuit in department.AntiqueSuit %}
  140.                             {% set antiqueSuitHref =  toolkit_route_localizer.generate('antique_suit_item',{'slug' : antiqueSuit.Translation[app.request.locale].slug}, app.request.locale) %}
  141.                             {% set img = openform_front_util.getImagePathByType(antiqueSuit.Thumb ?? '', 'list') %}
  142.                             <a class="news-item news-item--mak" href="{{ antiqueSuitHref }}" aria-label="{{ 'T_READ_MORE'|trans({}, 'openform_front', app.request.locale) }} {{ antiqueSuit.Translation[app.request.locale].title }}">
  143.                                 {% if img %}
  144.                                     <img class="news-item__image news-item__image--mak" loading="lazy" src="{{asset(img)}}" alt="{{ antiqueSuit.Translation[app.request.locale].alt }}">
  145.                                 {% endif %}
  146.                                 <div class="news-item__content">
  147.                                     <h2 class="news-item__title news-item__title--mak">{{ antiqueSuit.Translation[app.request.locale].titleHtml|raw }}</h2>
  148.                                     {#
  149.                                     <div class="news-item__date-wrapper">
  150.                                         <time class="news-item__date">
  151.                                             {{ antiqueSuit.publishDate|explodedDate(app.request.locale).D }}
  152.                                             {{ antiqueSuit.publishDate|explodedDate(app.request.locale).month }}
  153.                                             {{ antiqueSuit.publishDate|explodedDate(app.request.locale).y }}
  154.                                         </time>
  155.                                     </div>
  156.                                     #}
  157.                                     
  158.                                     <p class="news-item__text news-item__text--mak">{{ antiqueSuit.Translation[app.request.locale].shortLead }}</p>
  159.                                 </div>
  160.                             </a>
  161.                         {% endfor %}
  162.                     {% endif %}
  163.                 {% endfor %}
  164.             </div>
  165.         </div>
  166.     </section>
  167.     
  168.     {% if isDepartment %}
  169.         {% include "@openform_front_templates/_blocks_sections/block.html.twig" with { sections: openform_front_util.getSections(entity)|length > 0 ? openform_front_util.getSections(entity):''} %}
  170.     {% else %}
  171.         {% 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) : '' } %}
  172.     {% endif %}
  173.         
  174. {% endblock %}