Joomla!: Visual QuickStart Guide: Making Your Site Dynamic with Menus
Menus are the most important part of setting up a Joomla web site, because you use menus to display content. Menus not only control navigation but literally define how the content is laid out and presented to the user. Nothing appears on the web site without being linked to a menu item. Because your visitors access and view all information through the menu clicks, it’s vitally important to get them right. The menu modules control the placement (position) of the menu items on the site, and the menu items control the presentation and layout of the content being displayed.
The good news is, you can easily edit and change menus—like anything else created in Joomla—as you create the site. To add a menu, you must do three things:
- Create a menu module.
- Configure and enable the menu module in the Module Manager.
- Add menu items to the menu module.
Creating Menus
It’s important to understand how menus and modules are related. All menus are modules that contain menu items (links). After you create a menu, you must configure and enable the menu in the Module Manager. Often, when creating and modifying menus, you will find yourself going back and forth between the Menu Item Manager and the Module Manager. You will learn more about other types of modules in Chapter 5, “Working with Modules.”
To create a menu module:
- Choose Menus > Menu Manager.
The Menu Manager opens (Figure 4.1).
Figure 4.1 The Menu Manager
- On the toolbar, click New.
The New Menu page appears; this is where you create the new menu module.
- In the Unique Name field, type eventsmenu.
Joomla uses this name to identify the menu, so it must be unique. Use only alphanumeric characters without spaces. You can put underscores between words instead of spaces.
- In the Title field, type Events Menu.
This is the title of the menu that displays on your web site. You can choose to hide or show the title of the menu through the Module Manager.
- In the description field, type:
A place for past, present, and future family events.
- In the Module Title field, type Events Menu.
This is the name of the menu module, and it will be added to the Module Manager. If you leave this field blank, the menu will not be accessible (Figure 4.2).
Figure 4.2 The Create New Menu Module page
- Click Save.
- Repeating steps 1 through 7, create two more menus—one titled Albums Menu and one titled Recipes Menu.
The menus have been added and are now listed in the Menu Manager, but until they are enabled they will not show up on the site (Figure 4.3).
Figure 4.3 The new menus listed in the Menu Manager
To enable a menu module:
- Choose Extensions > Module Manager.
The Module Manager page opens (Figure 4.4). The newly created menu modules are all listed, but they aren’t enabled yet. (For a refresher on Module Manager fields, see Chapter 2, “Getting Started.”)
Figure 4.4 The Module Manager with the menus disabled
- In the Enabled column, click the red circled X for each menu module.
The Menu Modules are now enabled, as indicated by the green checkmarks in the Enabled column (Figure 4.5).
Figure 4.5 The Module Manager with the menus enabled
- Click the Preview link.
The menus are all listed on the front page (Figure 4.6). The menus may not be in the order you want them to appear, but you can change that by using positions.
Figure 4.6 The site with the new menus
To change the display order of menu modules:
- Choose Extensions > Module Manager.
The Module Manager opens. Because the main menu is the main navigation for the site, you want this menu to display first. The menus are currently in the order they were created (Figure 4.7).
Figure 4.7 The Module Manager showing the creation order of the menus
- For the Main Menu, type 1 in the Order column.
- For the Events menu, type 2 in the Order column.
- For the Albums menu, type 3 in the Order column.
- For the Recipes menu, type 4 in the Order column.
- Click the Save icon next to the Order column header.
You can also change the order by using the arrows next to the order number. This can be a more efficient way to reorder your modules when you have many modules and those modules are all in different positions. For now the four menus are in the correct order (Figure 4.8).
Figure 4.8 The Module Manager showing the menu ordering changed
- Click Preview.
The new menu ordering is reflected on the front page (Figure 4.9).
Figure 4.9 The front page with the menus displayed in order
To change a menu position:
- Choose Extensions > Module Manager.
The Module Manager opens with a list of all modules created or installed on your site.
The current design trend is to place the main navigation of a web site horizontally across the top, so you are going to change the position of this menu to place it across the top of the web site.
- Click the Main Menu link to open the Module Editor (Figure 4.10).
Figure 4.10 The Module Editor
You will use the Module Editor to configure all settings for the menu module. Each of the module settings will be covered throughout this chapter; for now you simply need to change the position of the main menu.
- In the Details area, choose hornav from the Position drop-down menu (Figure 4.11).
Figure 4.11 Choosing hornav for the Main Menu position
The position and the menu’s style are defined by the template.
- Click Save, and then click Preview.
You have just moved the main menu to the horizontal position styled by the template (Figure 4.12).
Figure 4.12 The front page displays the Main Menu in the horizontal position defined in your template
- Change the Albums and Recipes menus to the Right position.
The menu ordering changes as you group menus into different positions. Notice each menu is assigned an order according to the position (Figure 4.13).
Figure 4.13 The new menu position ordering
- Click Preview to see your changes (Figure 4.14).
Figure 4.14 The new menus positioned on the front page
To learn how to use the positions for your template, as well as how to create your own positions, see Chapter 9, “Creating Joomla Templates.”
To edit menu module details:
- Choose Extensions > Module Manager.
The Module Manager opens with a list of all modules created or installed on your site.
- Click the Main Menu link to open the Module Editor.
The Module Editor is where you configure the module details, menu assignments, and parameters. The module details control the display functions (Figure 4.16).
Figure 4.16 The menu module details
- Click the No radio button for Enabled.
The menu is no longer enabled, so it won’t show on the web site.
- Click Apply, and then click Preview (Figure 4.17).
Figure 4.17 A preview of the web site without a main menu
Notice that the menu no longer displays on the web site.
- Now re-enable the menu by clicking the Yes radio button for Enabled.
- Click Save, and then click Preview (Figure 4.18).
Figure 4.18 A preview of the web site with a main menu enabled
To use menu assignment:
- Choose Extensions > Module Manager.
The Module Manager opens with a list of all modules created or installed on your site.
- Click the Events Menu link to open the Module Editor.
The default is to assign menu modules to all menu items. Menu assignment tells Joomla when this menu module is to display on the page (Figure 4.19).
Figure 4.19 The menu assignment selections
- In the Menu Assignment area, click the “Select Menu Item(s) from the List” radio button.
- From the Menu Selections, choose Events.
Assigning the Events menu module to the Events menu item tells Joomla to display this module only when the user clicks the Events link in the Main Menu (Figure 4.20).
Figure 4.20 Assigning the Events menu module to the main menu Events link
- Click Save.
- Repeat steps 2 through 5 to assign the Albums menu module to the Home and Our Albums menu items.
- Repeat steps 2 through 5 to assign the Recipes menu module to the Home and Recipes menu.
As shown in steps 6 and 7, you can assign menu modules to multiple menu items. Command-click (Mac) or Control-click (Windows) to select multiple menu items.
The module assignment for each menu module is listed in the Pages column. All indicates the menu module is assigned to all menu items, and Varies indicates that it is assigned to some menu items (Figure 4.21).
Figure 4.21 Pages column showing which pages the menu module is assigned to
- Click Preview.
Click each of the links in the main menu to see the results. When you click Events, the Events Menu appears. When you click Albums, the Our Albums menu appears (Figure 4.22).
Figure 4.22 A preview of the Events menu on the Events section page