From c8d44dab0b735c927381d606351c0f5253f8343d Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Mon, 31 May 2021 19:52:39 +0200 Subject: [PATCH] add documentation --- docs/tree/index.md | 4 ++-- docs/tree/menu.md | 2 +- docs/tree/node.md | 60 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 docs/tree/node.md diff --git a/docs/tree/index.md b/docs/tree/index.md index 890a450..b99145f 100644 --- a/docs/tree/index.md +++ b/docs/tree/index.md @@ -4,8 +4,8 @@ Murph manages contents this way: * You define navigations * For each navigation, you define menus -* For each menu, you define elements (nodes) -* and for each element, you define: +* For each menu, you define nodes (elements) +* and for each node, you define: - an optional page - the routing - some attributes diff --git a/docs/tree/menu.md b/docs/tree/menu.md index 60246e0..ac2b69c 100644 --- a/docs/tree/menu.md +++ b/docs/tree/menu.md @@ -5,6 +5,6 @@ To create a menu, go to `Trees`, select the navigation and click on `Add a menu` * The `label` is the label displayed whenever necessary (eg: `Top menu`) * The `code` is an unique technical identifier (in the given navigation) and it is useful in templating, routing and settings (eg: `top`) -When a menu is created then an element is automatically generated. +When a menu is created then an node is automatically generated. ![](/_static/img/tree/02.png) diff --git a/docs/tree/node.md b/docs/tree/node.md new file mode 100644 index 0000000..3eb3a0d --- /dev/null +++ b/docs/tree/node.md @@ -0,0 +1,60 @@ +# Node + +A node allows you to create a tree structure in a menu. +To create or update a node, click on "Edit" or the sign "+". The basic information to fill is `label` but more parameters are accessible via 4 tabs: + +* Content +* Routing +* Attributes +* Sitemap + +## Content + +The content tab allow you to define an optional `Page` to associate to the node. You can also define that the node is an alias of another node. + +A page only represents the content and a way to display it by setting a template. + +To add a page in the list, edit `config/packages/app.yaml`: + +``` +core: + site: + pages: + App\Entity\Page\SimplePage: + name: 'Simple page' + templates: + - {name: "Default", file: "page/simple/default.html.twig"} + App\Entity\Page\YourPage: + name: 'Your page' + templates: + - {name: "Template 1", file: "page/your_page/template1.html.twig"} + - {name: "Template 2", file: "page/your_page/template2.html.twig"} +``` + +## Routing + +The routing tab is very important. It allows you to define all parameters related to: + +* The routing (obviously): + * An optional URL with parameters + * A route name generated using the code +* A custom content-type of the response (eg: 'text/plain') +* A custom controller called when the node is requested + +To add a controller in the list, edit `config/packages/app.yaml`: + +``` +core: + site: + controllers: + - {name: 'Foo', action: 'App\Controller\ExampleController::foo'} + - {name: 'Bar', action: 'App\Controller\OtherController::bar'} +``` + +## Attributes + +Attributes are a collection of keys and values attached to a node (eg: class, icon, whatever you want). + +## Sitemap + +This tab contains information to configure the sitemap.