From 3c3f680fdd28cbf4cd182dd1269ffc9c2b722bfa Mon Sep 17 00:00:00 2001 From: Francois Zaninotto Date: Mon, 22 Feb 2016 20:46:47 +0100 Subject: [PATCH] Document menu.template() method Closes #939 --- doc/Menus.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/doc/Menus.md b/doc/Menus.md index 547583e9..2d882551 100644 --- a/doc/Menus.md +++ b/doc/Menus.md @@ -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(` + + + Go to Example.com + ` + )) +); +``` + 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