You are here

function special_menu_items_init in Special menu items 7

Same name and namespace in other branches
  1. 6 special_menu_items.module \special_menu_items_init()

Implementation of hook_init().

File

./special_menu_items.module, line 164
Module to enable placeholder or separator menu items.Placeholder is a menu item which is actually not a link. Something like this is useful with drop down menus where we want to have a parent link which is actually not linking to a page but which is…

Code

function special_menu_items_init() {

  // Make breadcrumb of nolink menu item nonlinkable.
  $breadcrumb = drupal_get_breadcrumb();
  foreach ($breadcrumb as $key => $crumb) {
    if (strlen(strstr($crumb, '<nolink>')) > 0) {
      $crumb = strip_tags($crumb);
      $tag = variable_get('special_menu_items_nolink_tag', '<span>');
      $breadcrumb[$key] = special_menu_items_render_menu_item($tag, $crumb);
    }
  }
  drupal_set_breadcrumb($breadcrumb);
}