Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.

MILE (Menu Item Link Enhancer)

Attach a block to any menu link item.

How to install this module?

  • Install as you would any other contrib module
    • Use composer to download this module
    • Enable the module using either drush or Drupal UI

Post-Installation

  • Enable the module as any other from the admin section,
  • Edit a menu item. say from the main menu,
  • Under the fieldset MILE refrences, attach existing content to this menu item and save,
  • Check your main menu on the frontend to have this referenced content rendered in place of the boring text and hyperlink
  • You may have to style the menu dropdown, as need be.

Note

  • Because a block_content entity explicitly has no defined #theme/template, they were expected to always be rendered as a block.
  • This module provides a workaround until this gets added into Drupal core. See https://www.drupal.org/project/drupal/issues/2704331
  • This means, if you added block_content as a MILE reference and you see it themed incorrectly, you will have to use the template provided to you via this module:
block-content-mile.html.twig
block-content-mile--type-BLOCK_CONTENT_TYPE.html.twig
block-content-mile--type-BLOCK_CONTENT_TYPE--VIEW_MODE.html.twig

Use this template, ot its suggestions to theme your block_content entity!

This module does not provide any styling for the menu, or make a megamenu kind of a thing!