Skip to content

Commit 35effb1

Browse files
committed
Menu: Added more context and structure
1 parent 2b7dacb commit 35effb1

File tree

1 file changed

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

1 file changed

+48
-5
lines changed

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

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,35 @@ This page is a work in progress and may undergo further revisions, updates, or a
66

77
<figure><img src="../../../.gitbook/assets/menu.png" alt="" width="250"><figcaption><p>Menu</p></figcaption></figure>
88

9-
**JSON Manifest:**
9+
## Creating a custom menu
10+
11+
In this section, you can learn how to register and create a custom Menu for the Umbraco backoffice.
12+
13+
### Manifest
14+
15+
The manifest file can be created using either JSON or Typescript. Both methods are shown below.
16+
17+
{% tabs %}
18+
19+
{% tab title="Json" %}
20+
21+
We can create the manifest using json in the umbraco-package.json.
22+
1023
```json
1124
{
1225
"type": "menu",
1326
"alias": "My.Menu",
1427
"name": "My Menu"
1528
}
1629
```
30+
{% endtab %}
31+
32+
{% tab title="Typescript" %}
33+
34+
The manifest can also be written in TypeScript.
35+
36+
For this typescript example we used a [Backoffice Entry Point](../../extending-overview/extension-types/backoffice-entry-point) extension to register the manifests
1737

18-
**Typescript Manifest:**
1938
```typescript
2039
import { ManifestMenu } from "@umbraco-cms/backoffice/extension-registry";
2140

@@ -28,17 +47,31 @@ const menuManifest: Array<ManifestMenu> = [
2847
];
2948
```
3049

31-
## Menu Item
50+
{% endtab %}
51+
52+
{% endtabs %}
53+
54+
# Menu Item
3255

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

3558
Menu items are the items that appear in the menu.
3659

60+
## Creating a custom menu items
61+
62+
In this section, you can learn how to add custom Menu Items to your Umbraco backoffice Menu.
63+
64+
### Manifest
65+
3766
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.
3867

3968
The code snippets below show how to declare a new menu item using JSON or Typescript.
4069

41-
### JSON Manifest
70+
{% tabs %}
71+
72+
{% tab title="Json" %}
73+
74+
We can create the manifest using json in the umbraco-package.json.
4275

4376
```json
4477
{
@@ -53,7 +86,13 @@ The code snippets below show how to declare a new menu item using JSON or Typesc
5386
}
5487
```
5588

56-
### Typescript Manifest
89+
{% endtab %}
90+
91+
{% tab title="Typescript" %}
92+
93+
The manifest can also be written in TypeScript.
94+
95+
For this typescript example we used a [Backoffice Entry Point](../../extending-overview/extension-types/backoffice-entry-point) extension to register the manifests
5796

5897
```typescript
5998
const menuItemManifest: Array<ManifestMenuItem> = [
@@ -70,6 +109,10 @@ const menuItemManifest: Array<ManifestMenuItem> = [
70109
];
71110
```
72111

112+
{% endtab %}
113+
114+
{% endtabs %}
115+
73116
### The UI Element
74117

75118
#### Rendering menu items with Umbraco's UI menu item component

0 commit comments

Comments
 (0)