Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Menu Markup

Security covered Under active development 77 sites

This module allows you to add HTML markup, like icons or badges, to your Drupal menu titles. You can also display counts of specific content types next to menu items.

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
Drupal 8–10 · not 11

Ask your assistant about Menu Markup

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Aug 2023
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 1
Maintenance
Slowing

Release Timeline

Releases

Version Type Core PHP Release date
8.x-1.3 Stable 8–11 Nov 20, 2024
8.x-1.2 Stable 8–10 Aug 9, 2023
10.0.1 Stable 8–10 Aug 9, 2023