Skip to content

Commit 9e915a9

Browse files
author
GitHub Actions
committed
Apply technical reviews
1 parent 5409f96 commit 9e915a9

File tree

1 file changed

+98
-6
lines changed

1 file changed

+98
-6
lines changed

modules/configuring-the-global-header/proc-customize-rhdh-global-header.adoc

Lines changed: 98 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,79 @@
11
[id="customizing-your-product-global-header_{context}"]
22
= Customizing your {product} global header
33

4-
You can use dynamic plugins to extend the global header with additional buttons and customize the order and position of icons and features. For more information on enabling dynamic plugins, see link:{installing-and-viewing-dynamic-plugins-url}[{installing-and-viewing-dynamic-plugins-title}].
4+
You can use the `red-hat-developer-hub.backstage-plugin-global-header` dynamic plugin to extend the global header with additional buttons and customize the order and position of icons and features. Additionally, you can create and integrate your custom dynamic header plugins using the mount points provided by this new header feature, allowing you to further tailor to suit your needs.
5+
For more information on enabling dynamic plugins, see link:{installing-and-viewing-dynamic-plugins-url}[{installing-and-viewing-dynamic-plugins-title}].
6+
7+
.Default global header configuration
8+
9+
[source,yaml,subs="+attributes,+quotes"]
10+
----
11+
- package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-global-header
12+
disabled: false
13+
pluginConfig:
14+
app:
15+
sidebar:
16+
search: false
17+
settings: false
18+
dynamicPlugins:
19+
frontend:
20+
default.main-menu-items:
21+
menuItems:
22+
default.create:
23+
title: ''
24+
red-hat-developer-hub.backstage-plugin-global-header:
25+
mountPoints:
26+
- mountPoint: application/header
27+
importName: GlobalHeader
28+
config:
29+
position: above-main-content
30+
- mountPoint: global.header/component
31+
importName: SearchComponent
32+
config:
33+
priority: 100
34+
- mountPoint: global.header/component
35+
importName: Spacer
36+
config:
37+
priority: 99
38+
props:
39+
growFactor: 0
40+
- mountPoint: global.header/component
41+
importName: HeaderIconButton
42+
config:
43+
priority: 90
44+
props:
45+
title: Create...
46+
icon: add
47+
to: create
48+
- mountPoint: global.header/component
49+
importName: SupportButton
50+
config:
51+
priority: 80
52+
- mountPoint: global.header/component
53+
importName: NotificationButton
54+
config:
55+
priority: 70
56+
- mountPoint: global.header/component
57+
importName: Divider
58+
config:
59+
priority: 50
60+
- mountPoint: global.header/component
61+
importName: ProfileDropdown
62+
config:
63+
priority: 10
64+
- mountPoint: global.header/profile
65+
importName: MenuItemLink
66+
config:
67+
priority: 100
68+
props:
69+
title: Settings
70+
link: /settings
71+
icon: manageAccounts
72+
- mountPoint: global.header/profile
73+
importName: LogoutButton
74+
config:
75+
priority: 10
76+
----
577

678
To extend the functionality of the default global header, include any the following attributes in your global header entry:
779

@@ -11,7 +83,7 @@ Specifies the location of the header. Use `application/header` to specify it as
1183
`importName`::
1284
Specifies the component exported by the global header plugin.
1385
+
14-
The following header components are possible values for the `config` field in the `dynamic-plugins.default.yaml` file:
86+
The `red-hat-developer-hub.backstage-plugin-global-header` package (enabled by default) offers the following header components as possible mount point values:
1587

1688
- **`SearchComponent`**: Adds a search bar (enabled by default).
1789
- **`Spacer`**: Adds spacing in the header to position buttons at the end. Useful when you disable `SearchComponent`.
@@ -30,12 +102,24 @@ The following header components are possible values for the `config` field in th
30102
Specifies the position of the header. Supported values are `above-main-content` and `above-sidebar`.
31103

32104
.Prerequisites
33-
* You have configured the support URL in the `{my-app-config-file}` file.
34-
* You have installed the notifications plugin.
105+
* You must configure the support URL in the `{my-app-config-file}` file to display the *Support* button in the header.
106+
* You must install the notifications plugin to display the *Notifications* button in the header.
35107

36108
.Procedure
37109

38-
. Install your custom header as a dynamic plugin by adding your custom plugin configuration to your `dynamic-plugins.default.yaml` file. For example:
110+
. Copy the default configuration and modify the field values to suit your needs. You can adjust the `priority` value of each header component to control its position. Additionally, you can enable or disable components by adding or removing them from the configuration. To ensure that the remaining header icon buttons align with the end of the header before the profile dropdown button, set `config.props.growFactor` to `1` in the `Spacer` mount point to enable the `Spacer` component. For example:
111+
+
112+
[source,yaml]
113+
----
114+
- mountPoint: global.header/component
115+
importName: Spacer
116+
config:
117+
priority: 100
118+
props:
119+
growFactor: 1
120+
----
121+
122+
. To use your custom header, you must install it as a dynamic plugin by adding your plugin configuration to your `app-config-dynamic.yaml` file. For example:
39123
+
40124
[source,yaml,subs="+attributes,+quotes"]
41125
----
@@ -47,9 +131,17 @@ Specifies the position of the header. Supported values are `above-main-content`
47131
<package_name>:
48132
mountPoints:
49133
- mountPoint: application/header
50-
importName: _<Header_component_name>_
134+
importName: _<Application_Header_name>_
51135
config:
52136
position: above-main-content
137+
- mountPoint: global.header/component
138+
importName: _<Header_component_name>
139+
config:
140+
priority: 100
141+
- mountPoint: global.header/component
142+
importName: _<Header_component_name>
143+
config:
144+
priority: 90
53145
----
54146
+
55147
[NOTE]

0 commit comments

Comments
 (0)