Skip to content

Commit

Permalink
fix(preview): Fix preview template to take theme template into account
Browse files Browse the repository at this point in the history
  • Loading branch information
welcoMattic committed Oct 1, 2024
1 parent 79606f4 commit b0ebc1a
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 35 deletions.
2 changes: 2 additions & 0 deletions src/Resources/translations/messages.en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ monsieurbiz_cms_page:
actions:
create: 'Create a new page'
preview: 'Preview'
banner:
preview: 'Preview'
monsieurbiz_menu:
provider:
page: 'Page'
Expand Down
2 changes: 2 additions & 0 deletions src/Resources/translations/messages.fr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 2 additions & 0 deletions src/Resources/translations/messages.pl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
37 changes: 28 additions & 9 deletions src/Resources/views/Admin/Page/preview.html.twig
Original file line number Diff line number Diff line change
@@ -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 %}
<div style="
text-transform: uppercase;
line-height: 30px;
z-index: 999;
position:fixed;
top:0;
left:0;
height: 30px;
background-color: red;
width: 100%;
color: white;
font-weight: bold;
padding: 0 30px;
display: flex;
justify-content: space-between;
">
<div>
<a style="color: white;" href="{{ app.request.headers.get('referer') }}">&#x21A9; {{ 'monsieurbiz_cms_page.ui.back_to_admin' | trans }}</a>
</div>
<div>{{ 'monsieurbiz_cms_page.ui.banner.preview' | trans }}</div>
</div>

{{ parent() }}
{% endblock %}

{% block title %}{{ page.metaTitle }}{% endblock %}

Expand All @@ -15,11 +42,3 @@
<meta name="keywords" content="{{ page.metaKeywords }}"/>
{% endif %}
{% endblock %}

{% block content %}
<h1 class="ui monster dividing header">{{ page.title }}</h1>
<div>
{{ page.content|monsieurbiz_richeditor_render_field }}
</div>
{% endblock %}

26 changes: 0 additions & 26 deletions src/Resources/views/Shop/preview_layout.html.twig

This file was deleted.

0 comments on commit b0ebc1a

Please sign in to comment.