By default, Drupal will not accept HTML markup as part of a menu title. This module allows you to configure markup to be shown along with specific menu titles (including submenu items). This can be very handy if you want to show a glyphicon from Bootstrap or an icon from FontAwesome, etc. in front of your menu titles.

Additionally, this module has functionality that will easily allow you to put Bootstrap-style "badges" next to your menu items, representing node counts (e.h. "Articles (30)", etc.).

There are similar modules for D7, but they seem to have been abandoned. Further, this module takes the concept a step or two further with functionality.

To see a demo, visit the Incursus web site and check out our top navbar menu.

Requirements

No special requirements at this time.

Standard usage scenario

  1. Download and install the module.
  2. Open up the edit page for a menu link
  3. Expand the Menu Markup section to see the options
  4. Enter in your link markup
  5. A special token @title can be used to substitute in the translated original title text
  6. If you select a node count type, another special token called @nodeCount will be available representing the total count of published nodes of the selected type (useful for Bootstrap badges in menu items)

Example Link Markup

<span class="fa fa-home"></span>&nbsp;&nbsp;@title
<span class="fa fa-star"></span>&nbsp;&nbsp;<strong>@title</strong> <span class="badge">@nodeCount</span>

Caveats

Certain types of menu links (e.g. dropdown menu links) will only show changes once you clear the Drupal cache. Normal menu links should reflect changes immediately after saving.

Disclaimer

By design, this module allows the site administrator to add raw markup to menu items. By downloading and installing this module, you acknowledge that in the wrong hands, this module provides site administrators the ability to perform XSS injections against themselves. We take no responsibility if this module is misused, access to the module is not restricted properly, etc.

Similar/Related Modules

  1. Special Menu Items
  2. menu_attributes
Supporting organizations: 

Project information

Releases