Skip to content

Commit

Permalink
Display Update toolbar only in update context
Browse files Browse the repository at this point in the history
  • Loading branch information
maximehuran committed Jan 19, 2023
1 parent dff3e17 commit 21f7f09
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/Resources/config/routing/admin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ monsieurbiz_sylius_cms_page_admin:
alias: monsieurbiz_cms_page.page
section: admin
templates: "@SyliusAdmin\\Crud"
except: ['show']
except: ['show', 'update']
redirect: update
grid: monsieurbiz_cms_page
vars:
all:
subheader: monsieurbiz_cms_page.ui.pages_subheader
templates:
form: "@MonsieurBizSyliusCmsPagePlugin/Admin/Page/_form.html.twig"
toolbar: "@MonsieurBizSyliusCmsPagePlugin/Admin/Page/Update/_toolbar.html.twig"
index:
icon: 'file alternate'
type: sylius.resource
Expand All @@ -24,3 +23,20 @@ monsieurbiz_sylius_cms_page_ajax_generate_page_slug:
defaults:
_controller: MonsieurBiz\SyliusCmsPagePlugin\Controller\Admin\Page\PageSlugController::generateAction


monsieurbiz_cms_page_admin_page_update:
path: /pages/{id}/edit
methods: [GET, PUT, PATCH]
defaults:
_controller: monsieurbiz_cms_page.controller.page:updateAction
_sylius:
section: admin
permission: true
redirect: referer
template: "@SyliusAdmin/Crud/update.html.twig"
vars:
subheader: monsieurbiz_cms_page.ui.pages_subheader
icon: file alternate
templates:
form: "@MonsieurBizSyliusCmsPagePlugin/Admin/Page/_form.html.twig"
toolbar: "@MonsieurBizSyliusCmsPagePlugin/Admin/Page/Update/_toolbar.html.twig"

0 comments on commit 21f7f09

Please sign in to comment.