Menu Configuration
The configuration of the menu can be done using an YAML file. This file should be imported into your application configuration.
Here is how to include your configuration file to your config.yml standard file :
A menu can handle the following elements:
Type : section
A section is a separator of elements in the menu.
Item | Description | Required |
label | Label which should be displayed | Yes |
type | Type of element. Should be one of this page of documentation | Yes |
children | Any elements | No |
Type : submenu
It contains children, which could be any of the menu supported elements.
Item | Description | Required |
label | Label which should be displayed | Yes |
type | Type of element. Should be one of this page of documentation | Yes |
icon | The name of an icon used by your theme | Yes |
children | Any element | No |
Type : Sunshine List
Item | Description | Required |
label | Label which should be displayed | Yes |
type | Type of element. Should be one of this page of documentation | Yes |
icon | The name of an icon used by your theme | Yes |
entityName | Name of the entity in your configuration to display | Yes |
Type : Sunshine page
Item | Description | Required |
label | Label which should be displayed | Yes |
type | Type of element. Should be one of this page of documentation | Yes |
icon | The name of an icon used by your theme | Yes |
parameters/id | Id of the targeted page as it has been configured in your configuration | Yes |
Type : route
Item | Description | Required |
label | Label which should be displayed | Yes |
type | Type of element. Should be one of this page of documentation | Yes |
icon | The name of an icon used by your theme | Yes |
route | name of the route available in your application | Yes |
parameters | Any parameter you need to push to the route | Yes |
Type : External page
Item | Description | Required |
label | Label which should be displayed | Yes |
type | Type of element. Should be one of this page of documentation | Yes |
icon | The name of an icon used by your theme | Yes |
parameters/url | Url of the page | Yes |
target | Any of HTML compliant targets | Yes |
Roles & Permissions configuration
You may need to configure menu items to be available only for specific users based on their roles and/or permissions. You may achieve this by adding a security parameter for each menu item you want to control access to.
See example below :
Last updated