Adds the ability to set a menu item as redirect to a page or first child.

Using redirects will prevent multiple menu items from being in active menu trail at the same time. The 'first-child' redirect allows you to have unique menu item that automatically forward the first child menu item when selected.

Very useful if you want...

  • A high level menu item in your navigation to redirect to lower level menu item.
  • A menu item in your navigation that just expands and selects the first child below the menu item.
Please note: If the menu's link path is set to 'first-child' then the 'redirect' attribute is ignored because 'first-child' link path is a redirect to the first child menu item. (aka drupal_goto)

Related Issues

Functions

NameDescription
menu_helper_redirect_form_menu_edit_item_alterImplementation of hook_form_FORM_ID_alter(). See alsomenu_helper_redirect_form_menu_edit_item_alter_submit()
menu_helper_redirect_gotoCallback for redirect/% router item.
menu_helper_redirect_menuImplementation of hook_menu().
_menu_helper_redirect_form_menu_edit_item_alter_post_submitSet the menu item's first-child path for an inserted (new) menu item.
_menu_helper_redirect_form_menu_edit_item_alter_pre_submitSet the menu item's reset_depth before the menu_edit_item form is submitted.
_menu_helper_redirect_get_active_branchGet active branch from tree
_menu_helper_redirect_get_first_child_pathGet first child from tree
_menu_helper_redirect_set_form_weightsSet form elements weight