Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3443488
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
drupal-3443488
Commits
df83f786
Commit
df83f786
authored
15 years ago
by
Dries Buytaert
Browse files
Options
Downloads
Patches
Plain Diff
- Patch
#536788
by jhodgdon | joachim: Fixed Provide documentation on making menu tabs.
parent
cd1ab0ff
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/menu/menu.api.php
+29
-0
29 additions, 0 deletions
modules/menu/menu.api.php
modules/menu/menu.js
+19
-0
19 additions, 0 deletions
modules/menu/menu.js
with
48 additions
and
0 deletions
modules/menu/menu.api.php
+
29
−
0
View file @
df83f786
...
...
@@ -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.
*
...
...
This diff is collapsed.
Click to expand it.
modules/menu/menu.js
+
19
−
0
View file @
df83f786
...
...
@@ -10,4 +10,23 @@ Drupal.behaviors.menuFieldsetSummaries = {
}
};
Drupal
.
behaviors
.
menuDisplayForm
=
{
attach
:
function
()
{
$
(
'
fieldset#edit-menu .form-item:first
'
).
before
(
'
<div class="form-item form-type-checkbox form-item-menu-create"><label for="edit-menu-create" class="option"><input type="checkbox" class="form-checkbox" id="edit-menu-create" name="menu[create]"/>
'
+
Drupal
.
t
(
'
Create a menu item.
'
)
+
'
</label></div>
'
);
$
(
'
fieldset#edit-menu .form-item:gt(0)
'
).
hide
();
$
(
'
#edit-menu-create
'
).
change
(
function
()
{
if
(
$
(
this
).
is
(
'
:checked
'
)){
$
(
'
fieldset#edit-menu .form-item:gt(0)
'
).
show
();
$
(
'
#edit-menu-link-title
'
).
val
(
Drupal
.
checkPlain
(
$
(
'
#edit-title
'
).
val
())).
change
();
}
else
{
$
(
'
fieldset#edit-menu .form-item:gt(0)
'
).
hide
();
$
(
'
#edit-menu-link-title
'
).
val
(
''
).
change
();
}
});
$
(
'
#edit-menu-link-title
'
).
keyup
(
function
()
{
$
(
'
#edit-menu-create
'
).
attr
(
'
checked
'
,
$
(
this
).
val
());
});
}
};
})(
jQuery
);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment