Skip to content

Commit a0885d7

Browse files
author
Maxime Leclercq
committed
chore: display warning message in admin if the block is deleted
1 parent 4ad8efa commit a0885d7

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

src/Resources/translations/messages.en.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ monsieurbiz_cms_block:
77
cms_content: "CMS content"
88
blocks_subheader: "CMS block management"
99
back_to_admin: "Back to admin"
10+
block_not_found: 'Block "%name%" not found.'
1011
form:
1112
block_info: 'Block information'
1213
block_content: 'Block content'

src/Resources/translations/messages.fr.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ monsieurbiz_cms_block:
77
cms_content: "Contenu CMS"
88
blocks_subheader: "Gestion des blocs CMS"
99
back_to_admin: "Retour à l'administration"
10+
block_not_found: 'Le bloc "%name%" n''a pas été trouvé.'
1011
form:
1112
block_info: 'Informations sur le bloc'
1213
block_content: 'Contenu du bloc'

src/Resources/views/Admin/UiElement/block.html.twig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,8 @@ element methods:
1010
{% set blockEntity = ui_element.getBlock(element.block) %}
1111
{% if blockEntity and blockEntity.enabled %}
1212
{{ blockEntity.content|monsieurbiz_richeditor_render_field }}
13+
{% else %}
14+
<div class="ui orange message">
15+
{{ 'monsieurbiz_cms_block.ui.block_not_found'|trans({'%name%': element.block}) }}
16+
</div>
1317
{% endif %}

0 commit comments

Comments
 (0)