summaryrefslogtreecommitdiff
path: root/modules/menu/menu.api.php
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-10-03 17:43:52 +0000
committerDries Buytaert <dries@buytaert.net>2009-10-03 17:43:52 +0000
commitdf83f78622632aa72e2e78f8eeff450190f1bc7d (patch)
treed50c0d67f43150106a3df8e80351378421e1edb2 /modules/menu/menu.api.php
parentcd1ab0ff016281014bace60028912f13e7386c39 (diff)
downloadbrdo-df83f78622632aa72e2e78f8eeff450190f1bc7d.tar.gz
brdo-df83f78622632aa72e2e78f8eeff450190f1bc7d.tar.bz2
- Patch #536788 by jhodgdon | joachim: Fixed Provide documentation on making menu tabs.
Diffstat (limited to 'modules/menu/menu.api.php')
-rw-r--r--modules/menu/menu.api.php29
1 files changed, 29 insertions, 0 deletions
diff --git a/modules/menu/menu.api.php b/modules/menu/menu.api.php
index 3b1c7bdf6..223fc2df0 100644
--- a/modules/menu/menu.api.php
+++ b/modules/menu/menu.api.php
@@ -116,6 +116,35 @@
* @endcode
* See @link form_api Form API documentation @endlink for details.
*
+ *
+ * You can also make groups of menu items to be rendered (by default) as tabs
+ * on a page. To do that, first create one menu item of type MENU_NORMAL_ITEM,
+ * with your chosen path, such as 'foo'. Then duplicate that menu item, using a
+ * subdirectory path, such as 'foo/tab1', and changing the type to
+ * MENU_DEFAULT_LOCAL_TASK to make it the default tab for the group. Then add
+ * the additional tab items, with paths such as "foo/tab2" etc., with type
+ * MENU_LOCAL_TASK. Example:
+ * @code
+ * // This will make "Foo settings" appear on the admin Config page
+ * $items['admin/config/foo'] = array(
+ * 'title' => 'Foo settings',
+ * 'type' => MENU_NORMAL_ITEM,
+ * // page callback, etc. need to be added here
+ * );
+ * // When you go to "Foo settings", "Global settings" will be the main tab
+ * $items['admin/config/foo/global'] = array(
+ * 'title' => 'Global settings',
+ * 'type' => MENU_DEFAULT_LOCAL_TASK,
+ * // page callback, etc. need to be added here
+ * );
+ * // Make an additional tab called "Node settings"
+ * $items['admin/config/foo/node'] = array(
+ * 'title' => 'Node settings',
+ * 'type' => MENU_LOCAL_TASK,
+ * // page callback, etc. need to be added here
+ * );
+ * @endcode
+ *
* This hook is rarely called (for example, when modules are enabled), and
* its results are cached in the database.
*