|
1 | 1 | {% extends '@SyliusShop/layout.html.twig' %} |
2 | 2 |
|
| 3 | +{% 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) %} |
| 4 | + |
3 | 5 | {%- block title -%} |
4 | | - {% if page.title is not empty %} |
| 6 | + {% if page.title is not empty and published == true %} |
5 | 7 | {{ page.title }} |
6 | 8 | {% else %} |
7 | 9 | {{ parent() }} |
8 | 10 | {% endif %} |
9 | 11 | {%- endblock -%} |
10 | 12 |
|
11 | 13 | {% block metatags %} |
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 }}"/> |
| 14 | + {% if published == true %} |
| 15 | + {% if page.metaKeywords is not empty %} |
| 16 | + <meta name="keywords" content="{{ page.metaKeywords }}"/> |
| 17 | + {% endif %} |
| 18 | + {% if page.metaDescription is not empty %} |
| 19 | + <meta name="description" content="{{ page.metaDescription }}"/> |
| 20 | + {% endif %} |
17 | 21 | {% endif %} |
18 | 22 | {% endblock %} |
19 | | - |
20 | 23 | {% block content %} |
21 | | - <div class="ui breadcrumb"> |
22 | | - <a href="{{ path('sylius_shop_homepage') }}" class="section">{{ 'sylius.ui.home'|trans }}</a> |
23 | | - <div class="divider"> /</div> |
24 | | - <div class="active section">{{ page.breadcrumb }}</div> |
25 | | - </div> |
26 | | - <div class="ui segment"> |
27 | | - <h1 class="ui dividing header bitbag-page-name">{{ page.name }}</h1> |
| 24 | + {% if published == true %} |
| 25 | + <div class="ui breadcrumb"> |
| 26 | + <a href="{{ path('sylius_shop_homepage') }}" class="section">{{ 'sylius.ui.home'|trans }}</a> |
| 27 | + <div class="divider"> /</div> |
| 28 | + <div class="active section">{{ page.breadcrumb }}</div> |
| 29 | + </div> |
| 30 | + <div class="ui segment"> |
| 31 | + <h1 class="ui dividing header bitbag-page-name">{{ page.name }}</h1> |
28 | 32 |
|
29 | | - <div class="ui grid center aligned"> |
30 | | - <div class="eight wide column"> |
31 | | - {% if page.image %} |
32 | | - <img class="page-image ui fluid image" src="{{ page.image.path }}" alt=""> |
33 | | - {% endif %} |
| 33 | + <div class="ui grid center aligned"> |
| 34 | + <div class="eight wide column"> |
| 35 | + {% if page.image %} |
| 36 | + <img class="page-image ui fluid image" src="{{ page.image.path }}" alt=""> |
| 37 | + {% endif %} |
| 38 | + </div> |
34 | 39 | </div> |
35 | | - </div> |
36 | 40 |
|
37 | | - <div class="ui hidden divider"></div> |
| 41 | + <div class="ui hidden divider"></div> |
38 | 42 |
|
39 | | - <div class="bitbag-page-content">{{ bitbag_cms_render_content(page) }}</div> |
40 | | - <div class="ui dividing header"></div> |
41 | | - <div class="bitbag-page-sections"> |
42 | | - {% include '@BitBagSyliusCmsPlugin/Shop/Page/Show/_sections.html.twig' %} |
43 | | - </div> |
44 | | - </div> |
45 | | - {% if page.products|length > 0 %} |
46 | | - <h2> |
47 | | - {{ 'bitbag_sylius_cms_plugin.ui.page_related_products'|trans }} |
48 | | - </h2> |
49 | | - <div class="bitbag-page-products"> |
50 | | - {% include '@SyliusShop/Product/_horizontalList.html.twig' with {'products': page.products} %} |
| 43 | + <div class="bitbag-page-content">{{ bitbag_cms_render_content(page) }}</div> |
| 44 | + <div class="ui dividing header"></div> |
| 45 | + <div class="bitbag-page-sections"> |
| 46 | + {% include '@BitBagSyliusCmsPlugin/Shop/Page/Show/_sections.html.twig' %} |
| 47 | + </div> |
51 | 48 | </div> |
| 49 | + {% if page.products|length > 0 %} |
| 50 | + <h2> |
| 51 | + {{ 'bitbag_sylius_cms_plugin.ui.page_related_products'|trans }} |
| 52 | + </h2> |
| 53 | + <div class="bitbag-page-products"> |
| 54 | + {% include '@SyliusShop/Product/_horizontalList.html.twig' with {'products': page.products} %} |
| 55 | + </div> |
| 56 | + {% endif %} |
| 57 | + {% else %} |
| 58 | + {% include '@BitBagSyliusCmsPlugin/Shop/Page/Error/_notPublished.html.twig' with {'publishAt': page.publishAt} %} |
52 | 59 | {% endif %} |
| 60 | + |
53 | 61 | {% endblock %} |
0 commit comments