From b0ebc1a298051a025dd89a2968ebc8b001702b1c Mon Sep 17 00:00:00 2001 From: Mathieu Santostefano Date: Tue, 1 Oct 2024 16:56:27 +0200 Subject: [PATCH] fix(preview): Fix preview template to take theme template into account --- src/Resources/translations/messages.en.yaml | 2 + src/Resources/translations/messages.fr.yaml | 2 + src/Resources/translations/messages.pl.yaml | 2 + .../views/Admin/Page/preview.html.twig | 37 ++++++++++++++----- .../views/Shop/preview_layout.html.twig | 26 ------------- 5 files changed, 34 insertions(+), 35 deletions(-) delete mode 100644 src/Resources/views/Shop/preview_layout.html.twig diff --git a/src/Resources/translations/messages.en.yaml b/src/Resources/translations/messages.en.yaml index 95a3a5a..63fc374 100644 --- a/src/Resources/translations/messages.en.yaml +++ b/src/Resources/translations/messages.en.yaml @@ -24,6 +24,8 @@ monsieurbiz_cms_page: actions: create: 'Create a new page' preview: 'Preview' + banner: + preview: 'Preview' monsieurbiz_menu: provider: page: 'Page' diff --git a/src/Resources/translations/messages.fr.yaml b/src/Resources/translations/messages.fr.yaml index 31f7e2b..35d786b 100644 --- a/src/Resources/translations/messages.fr.yaml +++ b/src/Resources/translations/messages.fr.yaml @@ -24,6 +24,8 @@ monsieurbiz_cms_page: actions: create: 'Créer une nouvelle page' preview: 'Prévisualiser' + banner: + preview: 'Prévisualisation' monsieurbiz_menu: provider: page: 'Page' diff --git a/src/Resources/translations/messages.pl.yaml b/src/Resources/translations/messages.pl.yaml index 64049ae..7829e13 100644 --- a/src/Resources/translations/messages.pl.yaml +++ b/src/Resources/translations/messages.pl.yaml @@ -24,6 +24,8 @@ monsieurbiz_cms_page: actions: create: 'Utwórz nową stronę' preview: 'Podgląd' + banner: + preview: 'Podgląd' monsieurbiz_menu: provider: page: 'Strona' diff --git a/src/Resources/views/Admin/Page/preview.html.twig b/src/Resources/views/Admin/Page/preview.html.twig index 07faa88..6886edc 100644 --- a/src/Resources/views/Admin/Page/preview.html.twig +++ b/src/Resources/views/Admin/Page/preview.html.twig @@ -1,4 +1,31 @@ -{% extends '@MonsieurBizSyliusCmsPagePlugin/Shop/preview_layout.html.twig' %} +{# This extends takes account of the potential theme template #} +{% extends '@MonsieurBizSyliusCmsPagePlugin/Shop/Page/show.html.twig' %} + +{% block top %} +
+
+ ↩ {{ 'monsieurbiz_cms_page.ui.back_to_admin' | trans }} +
+
{{ 'monsieurbiz_cms_page.ui.banner.preview' | trans }}
+
+ + {{ parent() }} +{% endblock %} {% block title %}{{ page.metaTitle }}{% endblock %} @@ -15,11 +42,3 @@ {% endif %} {% endblock %} - -{% block content %} -

{{ page.title }}

-
- {{ page.content|monsieurbiz_richeditor_render_field }} -
-{% endblock %} - diff --git a/src/Resources/views/Shop/preview_layout.html.twig b/src/Resources/views/Shop/preview_layout.html.twig deleted file mode 100644 index be709f9..0000000 --- a/src/Resources/views/Shop/preview_layout.html.twig +++ /dev/null @@ -1,26 +0,0 @@ -{% extends '@SyliusShop/layout.html.twig' %} - -{% block top %} -
-
- ↩ {{ 'monsieurbiz_cms_page.ui.back_to_admin' | trans }} -
-
{{ 'monsieurbiz_cms_page.ui.actions.preview' | trans }}
-
- - {{ parent() }} -{% endblock %}