You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/customizing-the-appearance/proc-customize-rhdh-sidebar-menuitems.adoc
+94-19Lines changed: 94 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ dynamicPlugins:
17
17
<plugin_name>: # <1>
18
18
menuItems:
19
19
<menu_item_name>: # <2>
20
-
icon: # home | group | category | extension | school | _<your_icon>_ # <3>
20
+
icon: # home | group | category | extension | school | _<my_icon>_ # <3>
21
21
title: _<plugin_page_title>_ # <4>
22
22
priority: 10 # <5>
23
23
parent: favorites # <6>
@@ -33,6 +33,38 @@ dynamicPlugins:
33
33
<5> `priority`: (Optional) Sets the order in which menu items appear in the sidebar. The default priority is 0, which places the item at the bottom of the list. A higher priority value places the item higher in the sidebar. You can define this field for each section.
34
34
<6> `parent`: (Optional) Enter the parent menu item under which the current item is nested. If this field is used, the parent menu item must be defined elsewhere in the `menuItems` configuration of any enabled plugin. You can define this field for each section.
35
35
36
+
+
37
+
.Example `menuItems` configuration
38
+
[source,yaml,subs="+attributes"]
39
+
----
40
+
dynamicPlugins:
41
+
frontend:
42
+
<package_name>:
43
+
dynamicRoutes:
44
+
- path: /my-plugin
45
+
module: CustomModule
46
+
importName: FooPluginPage
47
+
menuItem:
48
+
icon: fooIcon
49
+
text: Foo Plugin Page
50
+
menuItems:
51
+
my-plugin: # <1>
52
+
priority: 10 # <2>
53
+
parent: favorites # <3>
54
+
favorites: # <4>
55
+
icon: favorite # <5>
56
+
title: Favorites # <6>
57
+
priority: 100 # <7>
58
+
----
59
+
<1> `my-plugin`: Matches `path` in `dynamicRoutes`
60
+
<2> `priority`: Controls order of plugins under the parent menu item.
61
+
<3> `parent`: Nests this plugin under the `favorites` parent menu item.
62
+
<4> `favourites`: Configuration for the parent menu item.
63
+
<5> `icon`: Displays the `favorite` icon from the {product-very-short} system icons.
64
+
<6> `title`: Displays the title name for the parent menu item.
65
+
<7> `priority`: Order of the `favourites` menu item in the sidebar.
66
+
67
+
36
68
. To modify a main menu item or add a custom menu item, add a section to the `default.main-menu-items` > `menuItems` section in your `{my-app-config-file}` file. Use the `default.` prefix to identify the key as a main menu item.
37
69
+
38
70
[source,yaml]
@@ -41,21 +73,64 @@ dynamicPlugins:
41
73
frontend:
42
74
default.main-menu-items:
43
75
menuItems:
44
-
default._<menu_item_name>_: # <1>
45
-
parent: _<my_menu_group>_ # <2>
46
-
priority: 10 # <3>
47
-
default._<menu_group_parent_item_name>_: # <4>
48
-
icon: # home | group | category | extension | school | _<your_icon>_ # <5>
49
-
title: _<my_menu_title>_ # <6>
50
-
to: _<path_to_the_target_page>_ # <7>
51
-
priority: 100 # <8>
52
-
----
53
-
<1> `default._<menu_item_name>_`: Enter the menu item name for which you want to override the default value. Add the `default.` prefix to identify a main menu item.
54
-
<2> `parent`: (Optional) Enter the parent menu item for this item. Required if <menu_item_name> is specified as the child of any menu items.
55
-
<3> `priority`: (Optional) Enter the order of this menu item within its menu level.
56
-
<4> `default._<menu_group_parent_item_name>_`: Enter the menu group parent item name to configure static main menu items.
57
-
<5> `icon`: Enter the menu group icon. Required for parent menu items.
58
-
<6> `title`: Enter the menu group title. Required for parent menu items. To hide the title from the sidebar, set the title as an (`" "`) empty string.
59
-
// Update <6> for release 1.6 as this option (currently a workaround) would be added as a functionality. RHIDP-6333.
60
-
<7> `to`: (Optional) Enter the path that the menu item navigates to. If not set, it defaults to the home page.
61
-
<8> `priority`: (Optional) Enter the order of the parent menu item in the sidebar.
76
+
default._<menu_group_parent_item_name>_: # <1>
77
+
icon: # home | group | category | extension | school | _<my_icon>_ # <2>
78
+
title: _<menu_group_parent_title>_ # <3>
79
+
priority: 10 # <4>
80
+
default._<menu_item_name>_: # <5>
81
+
parent: _<menu_group_parent_item_name>_ # <6>
82
+
icon: # home | group | category | extension | school | _<my_icon>_ # <7>
83
+
title: _<my_menu_title>_ # <8>
84
+
to: _<path_to_the_menu_target_page>_ # <9>
85
+
priority: 100 # <10>
86
+
----
87
+
<1> `default._<menu_group_parent_item_name>_`: Enter the menu group parent item name to configure static main menu items.
88
+
<2> `icon`: Enter the menu icon. Required for parent menu items.
89
+
<3> `title`: Enter the menu group title. Required for parent menu items. To hide the title from the sidebar, set the title as an (`" "`) empty string.
90
+
<4> `priority`: (Optional) Enter the order of this menu item within its menu level.
91
+
<5> `default._<menu_item_name>_`: Enter the menu item name for which you want to override the default value. Add the `default.` prefix to identify a main menu item.
92
+
<6> `parent`: (Optional) Enter the parent menu item for this item. Required if <menu_item_name> is specified as the child of any menu items.
93
+
<7> `icon`: (Optional) Enter the menu icon.
94
+
<8> `title`: Enter the menu group title. To hide the title from the sidebar, set the title as an (`" "`) empty string.
95
+
// Update <8> for release 1.6 as this option (currently a workaround) would be added as a functionality. RHIDP-6333.
96
+
<9> `to`: (Optional) Enter the path that the menu item navigates to. If not set, it defaults to the home page.
97
+
<10> `priority`: (Optional) Enter the order of this menu item within its menu level.
98
+
99
+
+
100
+
.Example `mainItems` configuration
101
+
102
+
[source,yaml]
103
+
----
104
+
default.main-menu-items:
105
+
menuItems:
106
+
default.catalog:
107
+
icon: school
108
+
title: Catalog124
109
+
priority: 5
110
+
default.learning-path:
111
+
title: ''
112
+
default.list:
113
+
title: Home
114
+
icon: bookmarks
115
+
default.home2:
116
+
parent: default.list
117
+
title: home2
118
+
icon: bookmarks
119
+
priority: 105
120
+
default.home1:
121
+
parent: default.list
122
+
title: home1
123
+
icon: bookmarks
124
+
priority: 205
125
+
default.home: # <1>
126
+
parent: default.home2 # <2>
127
+
default.list2:
128
+
title: References # <3>
129
+
icon: bookmarks # <4>
130
+
to: /create # <5>
131
+
----
132
+
<1> `default.home`: Specifies the main item name.
133
+
<2> `parent`: Nests this plugin under the `favorites` parent menu item.
134
+
<3> `title`: Specifies the name of `default.list2`
135
+
<4> `icon`: Displays the `bookmarks` icon.
136
+
<5> `to`: Redirects `default.list2` to the `/create` page.
0 commit comments