Skip to content

Commit 2b7dacb

Browse files
authored
Updated grammar and headings
1 parent 86f59a9 commit 2b7dacb

File tree

1 file changed

+13
-13
lines changed
  • 14/umbraco-cms/customizing/extending-overview/extension-types

1 file changed

+13
-13
lines changed

14/umbraco-cms/customizing/extending-overview/extension-types/menu.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,15 @@ const menuManifest: Array<ManifestMenu> = [
2828
];
2929
```
3030

31-
32-
## Menu Item <a href="#menu-item" id="menu-item"></a>
31+
## Menu Item
3332

3433
<figure><img src="../../../.gitbook/assets/menu-item.png" alt="" width="250"><figcaption><p>Menu Item</p></figcaption></figure>
3534

36-
### What is a Menu Item?
37-
3835
Menu items are the items that appear in the menu.
3936

40-
For adding custom menu items we can define a single MenuItem manifest and link an element to it. In this element we can fetch the data and render as many menu items as we want based on that data.
37+
To add custom menu items, you can define a single MenuItem manifest and link an element to it. In this element, you can fetch the data and render as many menu items as you want based on that data.
38+
39+
The code snippets below show how to declare a new menu item using JSON or Typescript.
4140

4241
### JSON Manifest
4342

@@ -55,6 +54,7 @@ For adding custom menu items we can define a single MenuItem manifest and link a
5554
```
5655

5756
### Typescript Manifest
57+
5858
```typescript
5959
const menuItemManifest: Array<ManifestMenuItem> = [
6060
{
@@ -70,13 +70,13 @@ const menuItemManifest: Array<ManifestMenuItem> = [
7070
];
7171
```
7272

73-
### The Lit Element
73+
### The UI Element
7474

7575
#### Rendering menu items with Umbraco's UI menu item component
7676

77-
To render your menu items in Umbraco, you can make use of the powerful [Umbraco UI Menu Item component](https://uui.umbraco.com/?path=/docs/uui-menu-item--docs). This component allows you to easily create nested menu structures with just a few lines of code.
77+
To render your menu items in Umbraco, you can use the [Umbraco UI Menu Item component](https://uui.umbraco.com/?path=/docs/uui-menu-item--docs). This component allows you to create nested menu structures with a few lines of code.
7878

79-
To display the caret icon indicating nested items, you can set the `has-children` attribute dynamically like this: `?has-children=${bool}`.
79+
By default, you can set the `has-children` attribute to display the caret icon indicating nested items. It will look like this: `?has-children=${bool}`.
8080

8181
**Example:**
8282

@@ -89,7 +89,7 @@ To display the caret icon indicating nested items, you can set the `has-children
8989

9090
#### Custom menu item element example
9191

92-
Using this Lit element we can fetch the data and render the menu items. By putting the result of the fetch in a `@state()`, we can trigger a re-render of the component when the data is fetched.
92+
You can fetch the data and render the menu items using the Lit element above. By putting the result of the fetch in a `@state()`, we can trigger a re-render of the component when the data is fetched.
9393

9494
**menu-items.ts:**
9595
```typescript
@@ -168,9 +168,9 @@ declare global {
168168

169169
```
170170

171-
## **Tree Menu Item**
171+
## Tree Menu Item
172172

173-
### **Manifest**
173+
### Manifest
174174

175175
```typescript
176176
// it will be something like this
@@ -186,14 +186,14 @@ declare global {
186186
}
187187
```
188188

189-
#### **Default Element**
189+
#### Default Element
190190

191191
```typescript
192192
// get interface
193193
interface UmbTreeMenuItemElement {}
194194
```
195195

196-
### **Adding menu items to an existing menu**
196+
### Adding menu items to an existing menu
197197

198198
The backoffice comes with a couple of menus.
199199

0 commit comments

Comments
 (0)