diff --git a/docs/admin-ui/getting-started.md b/docs/admin-ui/getting-started.md index 052a951b..b301e399 100644 --- a/docs/admin-ui/getting-started.md +++ b/docs/admin-ui/getting-started.md @@ -22,6 +22,10 @@ composer require sylius/admin-ui ## Minimalist templates +All these following templates are kind of "empty". + +You can install the optional [BootstrapAdminUi package](../bootstrap-admin-ui/getting-started.md) to configure their contents automatically. + ### Crud templates - crud/create.html.twig diff --git a/docs/bootstrap-admin-ui/getting-started.md b/docs/bootstrap-admin-ui/getting-started.md index 92b0967f..2059676d 100644 --- a/docs/bootstrap-admin-ui/getting-started.md +++ b/docs/bootstrap-admin-ui/getting-started.md @@ -5,6 +5,8 @@ description: >- # Getting started +This package configures content of the [AdminUi package](../admin-ui/getting-started.md) templates. + ## Installation Install the package using Composer and Symfony Flex: @@ -12,3 +14,89 @@ Install the package using Composer and Symfony Flex: ```bash composer require sylius/bootstrap-admin-ui ``` + +## Configuring the CRUD templates + +Content of CRUD templates is split into configurable blocks. + +You are able to add new blocks, disable existing ones, or reorder them using the [TwigExtra package](../twig-extra/getting-started.md). + +### Create + +This package configures content of the template to create a new resource. + +This adds configurable blocks into the `@SyliusAdminUi/crud/create.html.twig` template. + +**Overview of the blocks** + +```mermaid +flowchart LR + Template(Create template) --> Hook{Hook 'create'} + + Hook --> Sidebar([Sidebar]) + Hook --> Navbar([Navbar]) + Hook --> Content([Content]) + + Content --> HookContent{Hook 'content'} + + HookContent --> Flashes([Flashes]) + HookContent --> Header([Header]) + HookContent --> FormErrorAlert([Form Error Alert]) + HookContent --> Form([Form]) +``` + +**Overview of the block templates** + +```mermaid +flowchart LR + Template(@SyliusAdminUi/crud/create.html.twig) --> Hook{Hook 'create'} + + Hook --> Sidebar([@SyliusBootstrapAdminUi/shared/crud/common/sidebar.html.twig]) + Hook --> Navbar([@SyliusBootstrapAdminUi/shared/crud/common/navbar.html.twig]) + Hook --> Content([@SyliusBootstrapAdminUi/shared/crud/common/content.html.twig]) +``` + +### Index + +This package configures content of the template to list resources. + +This adds configurable blocks into the `@SyliusAdminUi/crud/index.html.twig` template. + +**Overview of the blocks** + +```mermaid +flowchart LR + Template(Index template) --> Hook{Hook 'index'} + + Hook --> Sidebar([Sidebar]) + Hook --> Navbar([Navbar]) + Hook --> Content([Content]) + + Content --> HookContent{Hook 'content'} + + HookContent --> Flashes([Flashes]) + HookContent --> Header([Header]) + HookContent --> Grid([Grid]) +``` + +### Show + +This package configures content of the template to show resource details. + +This adds configurable blocks into the `@SyliusAdminUi/crud/show.html.twig` template. + +**Overview of the blocks** + +```mermaid +flowchart LR + Template(Show template) --> Hook{Hook 'show'} + + Hook --> Sidebar([Sidebar]) + Hook --> Navbar([Navbar]) + Hook --> Content([Content]) + + Content --> HookContent{Hook 'content'} + + HookContent --> Flashes([Flashes]) + HookContent --> Header([Header]) +``` diff --git a/docs/cookbook/admin_panel/index.md b/docs/cookbook/admin_panel/index.md index 87ef8384..3d0422ae 100644 --- a/docs/cookbook/admin_panel/index.md +++ b/docs/cookbook/admin_panel/index.md @@ -100,18 +100,17 @@ return static function (ContainerConfigurator $containerConfigurator): void { You should decorate the `sylius_admin_ui.knp.menu_builder` service to customize the admin menu. ```php -