add page information when editing a node

This commit is contained in:
Simon Vieille 2021-10-06 10:24:00 +02:00
parent c751ee47ac
commit e4216c8974
2 changed files with 14 additions and 0 deletions

View file

@ -143,9 +143,19 @@ class NodeAdminController extends AdminController
]);
}
$page = $entity->getPage();
if ($page !== null) {
$pageConfiguration = $pageLocator->getPages()[get_class($page)] ?? null;
} else {
$pageConfiguration = null;
}
return $this->render('@Core/site/node_admin/edit.html.twig', [
'form' => $form->createView(),
'entity' => $entity,
'page' => $page,
'pageConfiguration' => $pageConfiguration,
'tab' => $tab,
]);
}

View file

@ -147,6 +147,10 @@
<div id="form-node-page-action-keep" class="collapse show" data-parent="#node-page-action">
<div class="card-body">
{{ 'No action'|trans }}
{% if page and pageConfiguration %}
({{ pageConfiguration.name }})
{% endif %}
</div>
</div>
</div>