Skip to content

Commit

Permalink
Document menu.template() method
Browse files Browse the repository at this point in the history
Closes #939
  • Loading branch information
fzaninotto committed Feb 22, 2016
1 parent 41c4f49 commit 3c3f680
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion doc/Menus.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,26 @@ admin.menu(nga.menu()
);
```

If the default menu template doesn't suite you, you can override it with the `template()` method. This will allow you, for instance, to add external links to the menu bar:

```js
admin.menu(nga.menu()
// add custom menu
.addChild(nga.menu().template(`
<a href="http://example.com">
<span class="glyphicon glyphicon-list"></span>
Go to Example.com
</a>`
))
);
```

By default parent menus will automatically close when none of their children are active. This can be deactivated with:
```js
nga.menu().autoClose(false);
```

This option is global and will affect all menu.
This option is global and will affect the entire menu sidebar.

*Tip*: `admin.menu()` is both a setter and a getter. You can modify an existing menu in the admin configuration by using `admin.menu().getChildByTitle()`
```js
Expand Down

0 comments on commit 3c3f680

Please sign in to comment.