Drupal - Customizing menu link output

theme_menu_link() did the trick. It contains an array under element of #original_link which has the menu name in it. Using that, I can add pipe delimited links to certain menus.

http://api.drupal.org/api/drupal/includes--menu.inc/function/theme_menu_link/7


This may be helpful. You can use preprocess functions to change or add something to menu link.

function THEME_preprocess_menu_link(&$variables) {
  $variables['element']['#below']['#markup'] = ' <span>→</span>';
}

In this code span added to every navigation link item.


Personally I'd just add the pipe with CSS - you don't really want the pipes in your markup as they're purely presentational:

.breadcrumb li:after {
  content: "|";
  margin: 0 5px; // optional styling nicety
}

.breadcrumb li:last-child::after {
  content: "";
}

Tags:

Routes

Theming

7