This chapter is from the book

This chapter is from the book

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:

Title: The menu title that displays above the menu when Show Title is set to Show.

Type: The unique identifier Joomla uses to identify this menu module.

Menu Items icon: Opens the Menu Item Manager for this menu module.

# Published: Displays the number of published menu items in this menu.

# Unpublished: Displays the number of unpublished menu items in this menu.

# Trash: Displays the number of menu items in the trash for this menu. Deleted menu items are held in the trash until permanently deleted.
If you delete a menu module, however, it is deleted immediately.

# Modules: Displays how many other modules are contained in this menu module. Menu modules can contain other modules.

ID: Displays the database ID number for this menu module.

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).

For small or simple sites, the main menu may be all you need. For large or more complex sites, duplicating the main menu with
individual menu modules may be necessary to speed up the loading of your site. The choice comes down to personal preference
and the site’s design.

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.”)

Positions are used to place modules anywhere around the main body of the page. All modules can be assigned to specific positions
defined by the template. Currently all menu modules are in the Left position. You can have multiple modules assigned to positions
and control the order in which they appear using the Module Manager.

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).

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).

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).

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.”

Tip

Templates define the positions for the web site. If you want to see where all the positions are located, from the front page
of your web site type www.mywebsite.com?tp=1 (Figure 4.15). The positions are all labeled on your web page.

Figure 4.15 Using the ?tp=1 command to display the positions of your template

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).

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.

Module Editor Details

Module Type: Identifies the kind of module.

Title: The title of the module.

Show Title: Shows or hides the module title. Selecting Yes shows the Title at the top of the module; selecting No hides the title.

Enabled: Enables the module to be used on the web site.

Position: Places the module in the position selected and uses the CSS styling from the template.

Order: Sets the order of this module and how it is displayed on the site.

Access Level: Defines who can see the module on the site according to their access level.

ID: The database ID number for this module.

Description: A brief description of the module.

Menu Assignment

All: Displays the menu on all pages.

None: Does not display the menu on any page. None is generally used to hide a menu. You can use hidden menus to display content
on a specific page, yet not display a menu with links you may not want available to the user.

Select: Allows you to select specifically the pages you want this menu displayed on.

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).

In summary, the menu module is a container for the menu items. This allows the module and the items to be styled individually
by the template, and it lets you place the menus in positions on the page and assign what pages the menus will or will not
appear on.