README
ADDING MENU BLOCKS
------------------
To add new menu blocks, use the "Add menu block" tab (or button) on the
administer blocks page, admin/build/block. You will then be able to configure
your menu block before adding it.
CONFIGURING MENU BLOCKS
-----------------------
When adding or configuring a menu block, several configuration options are
available:
Block title
For menu trees that start with the 1st level, the default block title will be
the menu name. For menu trees that start with the 2nd level or deeper, the
default block title will be the title for the parent menu item of the
specified level.
For example, if the active menu trail for the Navigation menu is: Administer >
Site building > Menus > Primary links, then a menu block configured to start
with the 1st level of the Navigation will display a block title of
"Navigation". And a menu block configured to start with the 3rd level of the
Navigation menu will display a block title of "Site building".
Block title as link
For menu trees that start with the 2nd level or deeper, the default block
title will be the title for the parent menu item of the specified level. If
this option is checked, the block title will be a link to that menu item.
Administrative title
To help identify the block on the administer blocks page, you can specify a
unique title to be used on that page. If blank, the regular title will be
used.
Menu name
Select the menu to use for the tree of links.
Starting level
Blocks that start with the 1st level will always be visible. Blocks that start
with the 2nd level or deeper will only be visible when the trail to the active
menu item is in the block's tree.
Make the starting level follow the active menu item
If the active menu item is deeper than the level specified above, the starting
level will follow the active menu item. Otherwise, the starting level of the
tree will remain fixed.
Maximum depth
From the starting level, specify the maximum depth of the tree. Blocks with a
maximum depth of 1 will just be a single un-nested list of links with none of
those links' children displayed.
Expand
All children of this menu will be expanded.
Sort
Sort each item in the active trail to the top of its level. When used on a
deep or wide menu tree, the active menu item's children will be easier to see
when the page is reloaded.
Fixed parent item
If you select a specific menu item, you alter the "starting level" and
"maximum depth" options to be relative to the fixed parent item. The tree of
links will only contain children of the selected parent item.
STYLING MENU BLOCKS
-------------------
Classes:
Themers should look at the myriad of classes added to the
elements.
configurable options of the block: menu-block-[block id number]
menu-name-[menu name] parent-mlid-[menu link ID] menu-level-[level number]
(compared to standard menu trees): first last menu-mlid-[menu link ID]
has-children active active-trail
The elements of the menu tree can have: active active-trail
Templates:
In addition, the wrapper
menu-block-wrapper.tpl.php template. And Menu block provides several theme hook
suggestions for that template:
- menu-block-wrapper--[block id number].tpl.php
- menu-block-wrapper--[menu name].tpl.php
For example, a file in your theme called
menu-block-wrapper--primary-links.tpl.php can be used to override the
just the "Primary links" menu blocks.
Theme functions:
Menu block uses Drupal core's menu theme functions. However, it also provides
theme hook suggestions that can be used to override any of the theme functions
called by it.
- theme_menu_tree() can be overridden by creating one of:
- [theme]_menu_tree__menu_block()
- [theme]_menu_tree__menu_block__[menu name]()
- [theme]_menu_tree__menu_block__[block id number]()
- theme_menu_item() can be overridden by creating one of:
- [theme]_menu_item__menu_block()
- [theme]_menu_item__menu_block__[menu name]()
- [theme]_menu_item__menu_block__[block id number]()
- theme_menu_item_link() can be overridden by creating one of:
- [theme]_menu_item_link__menu_block()
- [theme]_menu_item_link__menu_block__[menu name]()
- [theme]_menu_item_link__menu_block__[block id number]()
For example, if you created a garland_menu_tree__menu_block() function, it would
override theme_menu_tree() any time it was used by this module, but not when
used by any other module. Similarly, a garland_menu_item__menu_block__1()
function would override theme_menu_item(), but only for the first menu block in
your system (the menu block with an ID of 1).
MENU BLOCK API
--------------
Developers can use the API of this module to create their own menu trees outside
the confines of blocks. All of the publicly available API functions are
documented in the menu_block.module file.
In addition, Menu block implements HOOK_menu_block_get_menus(),
HOOK_menu_block_get_sort_menus() and HOOK_menu_block_tree_alter(). See
menu_block.api.php for documentation.
Senast uppdaterat
-
Stora Steget 2025
Artikel0 kommentarer
-
Skolflygläger i Dalsland
Artikel0 kommentarer
-
Ockelbo Ballongsällskap
Artikel1 kommentarer
-
Ballongmöte Helsingborg 29/8-31/8 2025
Artikel0 kommentarer
-
Hungarian and Slovenian Hot Air Balloon Championship
Artikel0 kommentarer
Kalender
-
2025-05-29 - 2025-05-31Skolflygläger , Högsäter
-
2025-06-06 - 2025-06-08Dalslandsmästerskapet , Högsäter
-
2025-07-11 - 2025-07-13Andréedagarna , Gränna
-
2025-08-16 - 2025-08-23Ballong EM 2025 , Wieselburg Österrike
-
2025-08-29 - 2025-08-31Helsingborgsmötet , Helsingborg