templates/bundles/BitBagSyliusCmsPlugin/Shop/Page/show.html.twig line 1

Open in your IDE?
  1. {% extends '@SyliusShop/layout.html.twig' %}
  2. {% set published = (page.publishAt is not null and page.publishAt|date("Y-m-d H:i:s") < "now"|date("Y-m-d H:i:s") or page.publishAt is null) %}
  3. {%- block title -%}
  4.     {% if page.title is not empty and published == true  %}
  5.         {{ page.title }}
  6.     {% else %}
  7.         {{ parent() }}
  8.     {% endif %}
  9. {%- endblock -%}
  10. {% block metatags %}
  11.     {% if published == true %}
  12.         {% if page.metaKeywords is not empty %}
  13.             <meta name="keywords" content="{{ page.metaKeywords }}"/>
  14.         {% endif %}
  15.         {% if page.metaDescription is not empty %}
  16.             <meta name="description" content="{{ page.metaDescription }}"/>
  17.         {% endif %}
  18.     {% endif %}
  19. {% endblock %}
  20. {% block content %}
  21.     {% if published == true %}
  22.         <div class="ui breadcrumb">
  23.             {% set sectionCode = page.sections.first().code ?? '' %}
  24.             {% set homeLink %}
  25.             {% if 'blog_posts' in sectionCode %}
  26.                 {{ path('app_blog') }}
  27.             {% elseif 'blog' in sectionCode %}
  28.                 {{ path('app_tech_knowledge') }}
  29.             {% else %}
  30.                 {{ path('sylius_shop_homepage') }}
  31.             {% endif %}
  32.             {% endset %}
  33.             <a href="{{ path('sylius_shop_homepage') }}" class="section">{{ 'sylius.ui.home'|trans }}</a>
  34.             <div class="divider">/</div>
  35.             {% if page.sections.first() is not empty %}
  36.                 <a href="{{ homeLink }}" class="section">{{ page.sections.first().name }}</a>
  37.                 <div class="divider">/</div>
  38.             {% endif %}
  39.             
  40.             <div class="active section">{{ page.name }}</div>
  41.         </div>
  42.         <div class="ui segment">
  43.             <h1 class="ui dividing header bitbag-page-name">{{ page.name }}</h1>
  44.             <div class="ui grid center aligned">
  45.                 <div class="wide column">
  46.                     {% if page.image %}
  47.                         <img class="page-image ui fluid image" src="{{ aws_s3_base_url ~ '/media/image' ~ page.image.path }}" alt="">
  48.                     {% endif %}
  49.                 </div>
  50.             </div>
  51.             <div class="bitbag-page-content">{{ bitbag_cms_render_content(page) | prepend_image_base_url }}</div>
  52.             {# <div class="ui dividing header"></div> #}
  53.             {# <div class="bitbag-page-sections"> #}
  54.                 {# {% include '@BitBagSyliusCmsPlugin/Shop/Page/Show/_sections.html.twig' %} #}
  55.             {# </div> #}
  56.         </div>
  57.         {% if page.products|length > 0 %}
  58.             <h2>
  59.                 {{ 'bitbag_sylius_cms_plugin.ui.page_related_products'|trans }}
  60.             </h2>
  61.             <div class="bitbag-page-products" data-js-products-carousel-id="related-products">
  62.                 {% include '@SyliusShop/Product/_horizontalList.html.twig' with {'products': page.products} %}
  63.             </div>
  64.         {% endif %}
  65.     {% else %}
  66.         {% include '@BitBagSyliusCmsPlugin/Shop/Page/Error/_notPublished.html.twig' with {'publishAt': page.publishAt} %}
  67.     {% endif %}
  68. {% endblock %}