Working with the Menu System IN THIS CHAPTER Introducing the Menu Manager Creating and managing menus Introducing the Menu Item Manager Creating and managing menu items Controlling acces
Trang 1Working with the
Menu System
IN THIS CHAPTER
Introducing the Menu Manager
Creating and managing menus Introducing the Menu Item Manager
Creating and managing menu items
Controlling access to menus and menu items
Menus are used to create the principal navigation links on the pages
of your web site Joomla! provides a number of tools for creating
and controlling your menus The constituent parts of Joomla’s
menu system are the menu items, which are grouped together into menus
that are displayed on the page through the use of menu modules Mastering
the menu system means gaining an awareness of how these parts are created
and managed
The Menu Manager enables the creation of the menus Each individual menu
is the subject of a dedicated Menu Item Manager and one or more menu
modules The Menu Item Manager handles the creation and configuration of
the items on the menu, while the module handles the actual display of the
menu on the page You control the placement of the menus by assigning the
various modules to the desired module positions
In this chapter, I go through the creation and management of menu and
menu items
Introducing the Menu Manager
The Menu Manager is a standard Joomla! component and is included with
the default Joomla! system You will use the Menu Manager to create and
manage all the menus on your Web site To access the Menu Manager, select
the option named Menus on the admin navigation bar, and then select the
option Menu Manager The Menu Manager interface loads in your browser
Figure 8.1 shows the Menu Manager as it appears in Joomla! 1.5.x with the
sample data installed
Trang 2FIGURE 8.1
The Joomla! 1.5.x Menu Manager interface
The toolbar at the top of the Menu Manager provides quick access to the following functions:
l Copy: Select a menu from the list and then click this icon to publish it.
l Delete: Select a menu from the list and then click this icon to delete the menu.
l Edit: Select a menu from the list and then click this icon to edit the menu details.
l New: Click to add a new menu.
l Help: Click to access the online Help files related to the active screen.
The main content area of the screen contains a list of all the menus in your Joomla! site The col-umns provided are:
l #: An indexing number assigned by Joomla! This number cannot be changed.
l Radio Button (no label): Click a radio button to select a menu; this is needed if you wish
to use several of the toolbar options, referenced above
l Title: This field displays the full name of the menu Click the name to edit the menu’s
Trang 3l Type: This field displays the system name for the menu The creator of the menu sets this.
l Menu Item(s): This icon is a link to the Menu Item Manager for each particular menu
Click to jump to that screen
l # Published: Shows the number of menu items published on the menu.
l # Unpublished: Shows the number of menu items unpublished on the menu.
l # Trash: Shows the number of menu items currently in the trash.
l # Modules: Indicates how many menu modules are associated with this menu.
l ID: The system-generated user ID number.
Finally, at the bottom of the screen, below the content area, is the Display # option Change the value in the combo box control to alter the number of menus that are displayed on the page The default value can be altered by changing the List Length option on the Global Configuration Manager
Joomla 1.6
The Joomla! 1.6 Menu Manager interface is slightly different in appearance from the Joomla! 1.5.x Menu Manager, but the functionality is almost exactly the same.
Creating and Managing Menus
All the front-end menus in the system are created and managed through the Menu Manager The sample data included with the Joomla! 1.5.x system includes a number of different menus, includ-ing the Main menu, the User menu, the Top menu, the Resources menu, Example Pages, and Key Concepts menus Those menus can be edited to change their contents to suit your needs, or you can create a new menu from scratch, using the New option on the Menu Manager
Understanding the relationship between menus and modules
As I mention previously, the Menu Manager and the Menu Items Manager are used to manage the menu contents, but the display of the menu is controlled by the menu module Every menu in the system has associated with it at least one menu module When a new menu is created, a new menu module is typically created by the system to enable the display of the menu
During the process of creating a new menu, the system prompts you to enter Module Title, which will be used to name the menu module for the menu If you leave this field blank, the system cre-ates the menu, but no module, resulting in the menu not being visible on the front end of the site All Menu modules are of the module type mod_mainmenu
Trang 4It is possible to create multiple menu modules for a single menu This technique is used primarily to create sub-menus, as discussed later in this chapter.
Creating a new menu
To create a new menu, click the New icon on the toolbar at the top of the Menu Manager Figure 8.2 shows the New Menu dialogue
FIGURE 8.2
The Joomla! 1.5.x New Menu dialogue
The toolbar at the top of the Menu Manager provides quick access to the following functions:
l Save: Click this icon to save your work, create a new menu, and exit the New Menu
dia-logue
l Cancel: Cancels the task and exits the New Menu dialogue.
l Help: Click to access the online help files related to the active screen.
Trang 5The fields in the workspace are:
l Unique Name: The value entered into this field will serve as the system name for the
menu This field accepts only lowercase letters with no spaces This field is required
l Title: Enter into this field a name for the menu This field is required.
l Description: Type a description for the menu This field is optional.
l Module Title: If you want to create a parallel menu module at this time, enter the name
in this field This is an optional field, but without it, you must first create a Menu module through the Module Manager in order to display the menu items on the front-end of the web site
Cross-Reference
Creating new Site modules is discussed in Chapter 20.
To create a new menu, follow these steps:
1 Log in to the admin system of your site.
2 Access the Menu Manager by clicking on the Menu Manager option under the
Menus option on the admin nav bar The Menu Manager loads in your browser.
3 On the Menu Manager interface, click the New icon on the toolbar at the top of the
Menu Manager The New Menu dialogue opens (Refer to Figure 8.2.)
4 In the Unique Name field, enter a machine-readable name for the menu This field
permits only lowercase letters with no spaces This field is required
5 In the Title field, type a name for the menu This field is required.
6 Complete any other fields you wish; all other fields are optional.
7 Click the Save icon on the toolbar at the top right to save your new menu The
dia-logue closes and returns you to the Menu Manager
Joomla 1.6
The Joomla! 1.6 New Menu Dialogue interface is slightly different in appearance from the Joomla! 1.5.x New Menu Dialogue, but the functionality is the same.
Copying a menu
You can create an exact copy of an existing menu, complete with its menu items Using the Copy function in the Menu Manager, the system will automatically create a copy of the menu, the menu items, and the menu’s associated module The new menu module will be assigned to the same module position as the original module and with the same access level
To copy a menu, click the copy icon at the top right of the Menu Manager The Copy Menu dia-logue loads in your browser, as shown in Figure 8.3
Trang 6FIGURE 8.3
The Copy Menu dialogue, showing the name of the menu being copied together with a list of all the menu Items on that menu
Caution
Copying an existing menu will result in a new menu module that is published by default - even if the original menu module was not enabled!
To copy a menu, follow these steps:
1 Open the Menu Manager.
2 Click the select box next to the Menu you want to copy.
3 Click the Copy icon on the top-right toolbar.
The Copy Menu dialogue opens (Refer to Figure 8.3.)
4 Type a name for New Menu Title.
5 Type a name for the New Module Name.
6 Click the Copy icon on the top-right toolbar The system creates a new menu and a
Trang 7Editing and deleting menus
Existing menus can be edited from the Menu Manager To edit a menu, either click the menu name
in the Menu Manager or select the menu and then click the Edit icon on the Menu Manager tool-bar Regardless of which method you use, the system opens the Edit Menu dialogue
The Edit Menu dialogue is identical to the New Menu dialogue, with the same fields and require-ments as discussed in the preceding section
To make changes to a menu, simply alter the desired fields in the Edit Menu dialogue, and then click the Save or Apply icon on the toolbar Any changes you have made will be applied immediately Complete menu deletion can be achieved through the Menu Manager Deletion from the Menu Manager bypasses the Trash Manager and deletes all the elements immediately Deleting a menu results in the removal of the menu itself, the items assigned the menu, and also the menu’s module
Note
While it is possible to delete a menu module without deleting the related menu, it is not possible to delete a menu without deleting the associated module.
To delete a menu, follow these steps:
1 Open the Menu Manager.
2 Select the menu you want to delete.
3 Click the Delete icon on the top right toolbar The Delete Menu dialogue opens.
4 Review the list of items to be deleted and then click the Delete icon on the toolbar
The system deletes the menu, the menu items, and the related menu module and then returns you to the Menu Manager
Caution
Deleting a menu also deletes the menu items associated with that menu and the related menu module Note that the menu items are not moved to the Trash — rather, they are deleted completely!
Caution
Do not delete the menu containing your site’s default menu item! In the standard configuration, that is the Main menu, which includes the home page In the default configuration, the home page link is the default menu item If you delete the menu containing the default menu item, your site will not function.
Introducing the Menu Item Manager
Where Joomla!’s Menu Manager is designed for handling the menus, the Menu Item Manager provides the interface for managing the individual items on each of the menus, as shown in