Drupal by nature is a hugely customizable platform and comes with a powerful menu system. Menus have been around since the early days of the CMS and remain one of its best features, making it easy for visitors to navigate and find specific areas of a website. Menus are also very intuitive, updating automatically as pages and paths are edited.
In this guide, we'll look at how you can create custom menus of your own.
Creating a menu
Before customizing a menu, a menu structure must be created. This is simply a blank canvas that is added to with menu items as it progresses.
Login to your Drupal administration panel (dashboard) and go to Structure > Menus. To create a new menu, click on the "Add menu" option.
On the next page you will be required to give the new menu a "Title" (i.e. My Menu) and "Description" (i.e. this will be my menu). The information given in the description section is for admin area use and not front end. Once this is done, click "Save" and you now have your basic menu structure.
Customizing the menu
With the menu structure in place, you can now begin adding items that will appear on the front end of your website to help visitors navigate their way to specific pages.
To begin, go to Structure > Menus, find your newly created menu and click on the "add link" option next to "edit menu" on the far right of the page; this will take you to a new page where you can begin adding the data for the link.
Options on this page are as follows:
- Menu link title – the anchor text that will displayed on the screen
- Path – can be an external URL such as http://drupal.org , or an internal path such as /node/8
- Description – provides visitors with a description of the menu when hovering over
- Enabled – tell whether item will be displayed in the menu (on by default)
- Show as expanded – displays subcategories under the parent menu if applicable (off by default).
- Parent link – a dropdown that allows the menu item to be placed under another item or menu
- Weight – a number used to set menu item order (lowest numbers first).
Only the Menu link title and Path are requirements here, the other options can be used entirely at your discretion.
When you have inputted the data that you require, click on the "Save" button at the bottom of the page to save your link. A green link message will confirm that work has been saved.
Your new link can now be found under "Menu link" in Menus, where it can be placed in an area of your site, or used to replace primary or secondary menus to provide your visitors with enhanced functionality.