|
1 | 1 | --- |
2 | | -description: Configuring sections in Umbraco UI Builder, the backoffice UI builder for Umbraco. |
| 2 | +description: Configuring and customizing sections in Umbraco UI Builder to organize and manage the backoffice interface effectively. |
3 | 3 | --- |
4 | 4 |
|
5 | 5 | # Sections |
6 | 6 |
|
7 | | -A section is a distinct area of the Umbraco backoffice, such as content, media, etc. The section is accessed via a link in the main menu at the top of the Umbraco interface. Umbraco UI Builder allows you to define multiple sections in order to organise the management of your models into logical sections. |
| 7 | +A section in Umbraco represents a distinct area within the backoffice, such as content, media, and so on. Sections are accessible via links in the main menu at the top of the Umbraco interface. Using Umbraco UI Builder, multiple sections can be defined to organize the management of models logically. |
8 | 8 |
|
9 | 9 |  |
10 | 10 |
|
11 | | -## Defining a section |
| 11 | +## Defining a Section |
12 | 12 |
|
13 | | -You can define a section by calling one of the `AddSection` methods on the root level `UIBuilderConfigBuilder` instance. |
| 13 | +Sections are defined using the `AddSection` method on the root-level `UIBuilderConfigBuilder` instance. |
14 | 14 |
|
15 | | -### **AddSection(string name, Lambda sectionConfig = null) : SectionConfigBuilder** |
| 15 | +### Example: Using the `AddSection()` Method |
16 | 16 |
|
17 | | -Adds a section to the Umbraco menu with the given name. |
| 17 | +This method adds a new section to the Umbraco menu with the specified name, allowing custom areas for organizing content in the backoffice. |
18 | 18 |
|
19 | 19 | ```csharp |
20 | | -// Example |
21 | 20 | config.AddSection("Repositories", sectionConfig => { |
22 | 21 | ... |
23 | 22 | }); |
24 | 23 | ``` |
25 | 24 |
|
26 | | -### **AddSectionBefore(string beforeAlias, string name, Lambda sectionConfig = null) : SectionConfigBuilder** |
| 25 | +**Code Reference:** `AddSection(string name, Lambda sectionConfig = null) : SectionConfigBuilder` |
27 | 26 |
|
28 | | -Adds a section to the Umbraco menu with the given name **before** the section with the given alias. |
| 27 | +### Example: Using the `AddSectionBefore()` Method |
| 28 | + |
| 29 | +This method adds a section before another section with the specified alias, allowing for customized ordering of sections in the backoffice. |
29 | 30 |
|
30 | 31 | ```csharp |
31 | | -// Example |
32 | 32 | config.AddSectionBefore("settings", "Repositories", sectionConfig => { |
33 | 33 | ... |
34 | 34 | }); |
35 | 35 | ``` |
36 | 36 |
|
37 | | -### **AddSectionAfter(string afterAlias, string name, Lambda sectionConfig = null) : SectionConfigBuilder** |
| 37 | +**Code Reference:** `AddSectionBefore(string beforeAlias, string name, Lambda sectionConfig = null) : SectionConfigBuilder` |
| 38 | + |
| 39 | +### Example: Using the `AddSectionAfter()` Method |
38 | 40 |
|
39 | | -Adds a section to the Umbraco menu with the given name **after** the section with the given alias. |
| 41 | +This method adds a section after another section with the specified alias, allowing for a custom order of sections in the backoffice. |
40 | 42 |
|
41 | 43 | ```csharp |
42 | | -// Example |
43 | 44 | config.AddSectionAfter("media", "Repositories", sectionConfig => { |
44 | 45 | ... |
45 | 46 | }); |
46 | 47 | ``` |
47 | 48 |
|
48 | | -## Changing a section alias |
| 49 | +**Code Reference:** `AddSectionAfter(string afterAlias, string name, Lambda sectionConfig = null) : SectionConfigBuilder` |
| 50 | + |
| 51 | +## Customizing the Section Alias |
49 | 52 |
|
50 | | -### **SetAlias(string alias) : SectionConfigBuilder** |
| 53 | +### Example: Setting a Custom Alias with `SetAlias()` |
51 | 54 |
|
52 | | -Sets the alias of the section. |
| 55 | +This method sets a custom alias for the section. |
53 | 56 |
|
54 | | -**Optional:** When adding a new section, an alias is automatically generated from the supplied name for you. However, if you need a specific alias you can use the `SetAlias` method to override this. |
| 57 | +*Optional:* By default, an alias is automatically generated from the section's name. To customize the alias, the `SetAlias()` method can be used. |
55 | 58 |
|
56 | 59 | ```csharp |
57 | | -// Example |
58 | 60 | sectionConfig.SetAlias("repositories"); |
59 | 61 | ``` |
60 | 62 |
|
61 | | -## Configuring the section tree |
| 63 | +**Code Reference:** `SetAlias(string alias) : SectionConfigBuilder` |
62 | 64 |
|
63 | | -### **Tree(Lambda treeConfig = null) : TreeConfigBuilder** |
| 65 | +## Configuring the Section Tree |
64 | 66 |
|
65 | | -Accesses the tree config of the current section. For more information check the [Trees documentation](trees.md). |
| 67 | +### Example: Using the `Tree()` Method for Configuration |
| 68 | + |
| 69 | +This method configures the tree structure for the section, which is used to organize content types. For more information, see the [Trees](trees.md) article. |
66 | 70 |
|
67 | 71 | ````csharp |
68 | | -// Example |
69 | 72 | sectionConfig.Tree(treeConfig => { |
70 | 73 | ... |
71 | 74 | }); |
72 | 75 | ```` |
73 | 76 |
|
74 | | -## Adding a dashboard to the section |
| 77 | +**Code Reference:** `Tree(Lambda treeConfig = null) : TreeConfigBuilder` |
| 78 | + |
| 79 | +## Adding Dashboards to the Section |
75 | 80 |
|
76 | | -### **AddDashboard(string name, Lambda dashboardConfig = null) : DashboardConfigBuilder** |
| 81 | +### Example: Adding a Dashboard with `AddDashboard()` |
77 | 82 |
|
78 | | -Adds a dashboard with the given name. For more information check the [Dashboards documentation](dashboards.md). |
| 83 | +This method adds a dashboard to the section with the specified alias, providing tools and features for content management. For more information, see the [Dashboards](dashboards.md) article. |
79 | 84 |
|
80 | 85 | ```csharp |
81 | | -// Example |
82 | 86 | sectionConfig.AddDashboard("Team", dashboardConfig => { |
83 | 87 | ... |
84 | 88 | }); |
85 | 89 | ``` |
86 | 90 |
|
87 | | -#### **AddDashboardBefore(string beforeAlias, string name, Lambda dashboardConfig = null) : DashboardConfigBuilder** |
| 91 | +**Code Reference:** AddDashboard(string name, Lambda dashboardConfig = null) : DashboardConfigBuilder |
88 | 92 |
|
89 | | -Adds a dashboard with the given name **before** the dashboard with the given alias. For more information check the [Dashboards documentation](dashboards.md). |
| 93 | +### Example: Using `AddDashboardBefore()` to Place a Dashboard |
| 94 | + |
| 95 | +This method adds a dashboard before another dashboard with the specified alias, allowing custom placement in the section. For more information, see the [Dashboards](dashboards.md) article. |
90 | 96 |
|
91 | 97 | ```csharp |
92 | | -// Example |
93 | 98 | sectionConfig.AddDashboardBefore("contentIntro", "Team", dashboardConfig => { |
94 | 99 | ... |
95 | 100 | }); |
96 | 101 | ``` |
97 | 102 |
|
98 | | -#### **AddDashboardAfter(string afterAlias, string name, Lambda dashboardConfig = null) : DashboardConfigBuilder** |
| 103 | +**Code Reference:** `AddDashboardBefore(string beforeAlias, string name, Lambda dashboardConfig = null) : DashboardConfigBuilder` |
| 104 | + |
| 105 | +### Example: Using `AddDashboardAfter()` to Place a Dashboard |
99 | 106 |
|
100 | | -Adds a dashboard with the given name **after** the dashboard with the given alias. For more information check the [Dashboards documentation](dashboards.md). |
| 107 | +This method adds a dashboard after another dashboard with the specified alias, giving control over dashboard order. For more information, see the [Dashboards](dashboards.md) article. |
101 | 108 |
|
102 | 109 | ```csharp |
103 | | -// Example |
104 | 110 | sectionConfig.AddDashboardAfter("contentIntro", "Team", dashboardConfig => { |
105 | 111 | ... |
106 | 112 | }); |
107 | 113 | ``` |
108 | 114 |
|
109 | | -## Extending an existing section |
| 115 | +**Code Reference:** `AddDashboardAfter(string afterAlias, string name, Lambda dashboardConfig = null) : DashboardConfigBuilder` |
110 | 116 |
|
111 | | -You can extend existing sections by adding Umbraco UI Builder trees and dashboards, context apps, and virtual subtrees. This can be done by calling the `WithSection` method on the root level `UIBuilderConfigBuilder` instance. |
| 117 | +## Extending Existing Sections |
112 | 118 |
|
113 | | -### **WithSection(string alias, Lambda sectionConfig = null) : WithSectionConfigBuilder** |
| 119 | +You can extend existing sections by adding Umbraco UI Builder trees and dashboards, context apps, and virtual subtrees. This can be done by calling the `WithSection` method on the root-level `UIBuilderConfigBuilder` instance. |
114 | 120 |
|
115 | | -Starts a sub-configuration for the existing Umbraco section with the given alias. |
| 121 | +### Example: Extending an Existing Section with `WithSection()` |
| 122 | + |
| 123 | +This method extends an existing section with additional configuration, enabling more customization for existing areas. |
116 | 124 |
|
117 | 125 | ```csharp |
118 | | -// Example |
119 | 126 | config.WithSection("member", withSectionConfig => { |
120 | 127 | ... |
121 | 128 | }); |
122 | 129 | ``` |
123 | 130 |
|
124 | | -## Adding a tree to an existing section |
| 131 | +**Code Reference:** `WithSection(string alias, Lambda sectionConfig = null) : WithSectionConfigBuilder` |
| 132 | + |
| 133 | +## Adding Trees to an Existing Section |
125 | 134 |
|
126 | | -### **AddTree(string name, string icon, Lambda treeConfig = null) : TreeConfigBuilder** |
| 135 | +### Example: Using the `AddTree()` Method |
127 | 136 |
|
128 | | -Adds a tree to the current section. For more information check the [Trees documentation](trees.md). |
| 137 | +This method adds a tree to the section, helping to visualize and organize content types. For more information, see the [Trees](trees.md) article. |
129 | 138 |
|
130 | 139 | ````csharp |
131 | | -// Example |
132 | 140 | withSectionConfig.AddTree("My Tree", "icon-folder", treeConfig => { |
133 | 141 | ... |
134 | 142 | }); |
135 | 143 | ```` |
136 | 144 |
|
137 | | -#### **AddTree(string groupName, string name, string icon, Lambda treeConfig = null) : TreeConfigBuilder** |
| 145 | +**Code Reference:** `AddTree(string name, string icon, Lambda treeConfig = null) : TreeConfigBuilder` |
138 | 146 |
|
139 | | -Adds a tree to the current section in a group with the given name. For more information check the [Trees documentation](trees.md). |
| 147 | +### Example: Grouping Trees with `AddTree()` Method |
| 148 | + |
| 149 | +This method adds a tree within a specified group, improving content organization by grouping related trees together. For more information, see the [Trees](trees.md) article. |
140 | 150 |
|
141 | 151 | ````csharp |
142 | | -// Example |
143 | 152 | withSectionConfig.AddTree("My Group", "My Tree", "icon-folder", treeConfig => { |
144 | 153 | ... |
145 | 154 | }); |
146 | 155 | ```` |
147 | 156 |
|
148 | | -#### **AddTreeBefore(string treeAlias, string name, string icon, Lambda treeConfig = null) : TreeConfigBuilder** |
| 157 | +**Code Reference:** `AddTree(string groupName, string name, string icon, Lambda treeConfig = null) : TreeConfigBuilder` |
| 158 | + |
| 159 | +## Adding a Tree Before or After an Existing Tree |
149 | 160 |
|
150 | | -Adds a tree to the current section **before** the tree with the given alias. For more information check the [Trees documentation](trees.md). |
| 161 | +### Example: Using `AddTreeBefore()` to Position a Tree |
| 162 | + |
| 163 | +This method adds a tree before another tree within the section, allowing you to customize the tree order. For more information, see the [Trees](trees.md) article. |
151 | 164 |
|
152 | 165 | ````csharp |
153 | | -// Example |
154 | 166 | withSectionConfig.AddTreeBefore("member", "My Tree", "icon-folder", treeConfig => { |
155 | 167 | ... |
156 | 168 | }); |
157 | 169 | ```` |
158 | 170 |
|
159 | | -#### **AddTreeAfter(string treeAlias, string name, string icon, Lambda treeConfig = null) : TreeConfigBuilder** |
| 171 | +**Code Reference:** `AddTreeBefore(string treeAlias, string name, string icon, Lambda treeConfig = null) : TreeConfigBuilder` |
| 172 | + |
| 173 | +### Example: Using `AddTreeAfter()` to Position a Tree |
160 | 174 |
|
161 | | -Adds a tree to the current section **after** the tree with the given alias. For more information check the [Trees documentation](trees.md). |
| 175 | +This method adds a tree after another tree within the section, enabling specific ordering of trees. For more information, see the [Trees](trees.md) article. |
162 | 176 |
|
163 | 177 | ````csharp |
164 | | -// Example |
165 | 178 | withSectionConfig.AddTreeAfter("member", "My Tree", "icon-folder", treeConfig => { |
166 | 179 | ... |
167 | 180 | }); |
168 | 181 | ```` |
169 | 182 |
|
170 | | -## Adding a dashboard to an existing section |
| 183 | +**Code Reference:** `AddTreeAfter(string treeAlias, string name, string icon, Lambda treeConfig = null) : TreeConfigBuilder` |
171 | 184 |
|
172 | | -### **AddDashboard (string name, Lambda dashboardConfig = null) : DashboardConfigBuilder** |
| 185 | +## Adding a Dashboard to an Existing Section |
173 | 186 |
|
174 | | -Adds a dashboard with the given name. For more information check the [Dashboards documentation](dashboards.md). |
| 187 | +### Example: Using the `AddDashboard()` Method |
| 188 | + |
| 189 | +This method adds a new dashboard to the section with the specified name. For more information, see the [Dashboards](dashboards.md) article. |
175 | 190 |
|
176 | 191 | ```csharp |
177 | | -// Example |
178 | 192 | withSectionConfig.AddDashboard("Team", dashboardConfig => { |
179 | 193 | ... |
180 | 194 | }); |
181 | 195 | ``` |
182 | 196 |
|
183 | | -### **AddDashboardBefore (string beforeAlias, string name, Lambda dashboardConfig = null) : DashboardConfigBuilder** |
| 197 | +**Code Reference:** `AddDashboard (string name, Lambda dashboardConfig = null) : DashboardConfigBuilder` |
| 198 | + |
| 199 | +### Example: Using the `AddDashboardBefore()` Method |
184 | 200 |
|
185 | | -Adds a dashboard with the given name **before** the dashboard with the given alias. For more information check the [Dashboards documentation](dashboards.md). |
| 201 | +This method adds a dashboard before the dashboard with the specified alias. For more information, see the [Dashboards](dashboards.md) article. |
186 | 202 |
|
187 | 203 | ```csharp |
188 | | -// Example |
189 | 204 | withSectionConfig.AddDashboardBefore("contentIntro", "Team", dashboardConfig => { |
190 | 205 | ... |
191 | 206 | }); |
192 | 207 | ``` |
193 | 208 |
|
194 | | -### **AddDashboardAfter (string afterAlias, string name, Lambda dashboardConfig = null) : DashboardConfigBuilder** |
| 209 | +**Code Reference:** `AddDashboardBefore (string beforeAlias, string name, Lambda dashboardConfig = null) : DashboardConfigBuilder` |
195 | 210 |
|
196 | | -Adds a dashboard with the given name **after** the dashboard with the given alias. For more information check the [Dashboards documentation](dashboards.md). |
| 211 | +### Example: Using the `AddDashboardAfter()` Method |
| 212 | + |
| 213 | +This method adds a dashboard after the dashboard with the specified alias. For more information, see the [Dashboards](dashboards.md) article. |
197 | 214 |
|
198 | 215 | ```csharp |
199 | | -// Example |
200 | 216 | withSectionConfig.AddDashboardAfter("contentIntro", "Team", dashboardConfig => { |
201 | 217 | ... |
202 | 218 | }); |
203 | 219 | ``` |
| 220 | + |
| 221 | +**Code Reference:** `AddDashboardAfter (string afterAlias, string name, Lambda dashboardConfig = null) : DashboardConfigBuilder` |
0 commit comments