Return to Snippet

Revision: 28116
at July 1, 2010 02:52 by MikeyLikesIt

Initial Code
function THEMENAME_menu_item_link($link) {
  if (empty($link['localized_options'])) {
    $link['localized_options'] = array();

  if (!$link['page_callback'] && strpos( $link['href'], '')) {
    return '<a href="javascript:void(0)" onclick="return false" class="nolink">'. $link['title'] .'</a>';
  else {
        return l($link['title'], $link['href'], $link['localized_options']);

Initial URL

Initial Description
This snippet allows admins to create menu items which do not link anywhere.  This is most useful in situations where one wants to have dropdown menus where the parent item should not be a link.

This same method could be used to create non-linking menu divider/headings.

Use for every menu item that should not be linkable.

Also, consider using to provide this capability.

Initial Title
Drupal Menu Items that are not links

Initial Tags

Initial Language