dding New Menu
In this subsub chapter, we will try to make new menu. By knowing the making of the new menu, you can make your own menu according to your needs. Here are the steps in making new menu:
- Open Menu Manager through Menus > Menu Manager.
- Click the New icon in the upper toolbar.
- You will get the form for making new menu (as in the picture 3.40). For the practice, we will make the PHP site menu.
Beneath are the items in the form:
– Unique Name: Write a unique name and it cannot be the same between one and another. There is no space in giving this name.
– Title: The menu title. The text that you are written here will be publicated.
– Description: The explanation for menu.
– Modul Title: The title which will be given into the module mod_mainmenu. If you do not fill this, the menu will not appear in the front end.
Click the Save icon in toolbar. After you keep it, the new menu appears in the lower order of Menu Manager.
Adding Menu Item
After making new menu, it is time for you to add new menu item. Here are the steps in making the menu item:
- Click icon in the Menu Item(s) colom.
- You will get Menu Item Manager. Click the New icon.
- Next, you will get the choice page of the menu item type. For this practice, choose External Link.
- Next, you will get form to get the detail information about the new menu item. Fill as the example in the picture 3.43.
- Click the Save button in the upper toolbar.
- You can repeat these steps again in order to make another new menu item.
The menu item which is already made by you will appear in the Menu Item Manager. In Menu Item Manager, you are allowed to copy, to move, to delete the menu item, and to edit it again.
You cannot still see your new menu in the front end yet. In order to see it, you have to activate it first. Here are the steps in activating your new menu:
- Open the Module Manager through Extensions > Module Manager.
- Find the new menu name in the module list.
- You will get the red icon in the Enabled colomn. It means that your menu is not active. In activating it, click the icon until it turns on into the green icon which means the menu is already active.
Now, open your Joomla! front end. You will see you new menu in the upper order.
Change the Menu Appearance
After seeing the appearing of the new menu in the front end, probably, you will think that: why its appearance does not the same with the other menu. Well, if we pay attention to the source code in the new menu, it can be such like this:
<li class=”item53″><a href=”http://www.phpeveryday.com”
target=”_blank”><span>Step By Step PHP</span></a></li>
<li class=”item54″><a href=”http://www.devshed.com”
<li class=”item55″><a href=”http://www.sitepoint.com”
Where did I can get that code? It is easy; you only have to click right in the browser. If you use Firefox, choose View Page Source. You will get the source code in that page. Now, we will compare the code with the Main Menu:
<li id=”current” class=”active item1″>
<li class=”parent item27″>
<a href=”/myjoomla/joomla-overview.html”><span>Joomla! Overview</span></a></li>
<a href=”/myjoomla/joomla-license.html”><span>Joomla! License</span></a></li>
<a href=”/myjoomla/more-about-joomla.html”><span>More about Joomla!</span></a></li>
Is there any difference between both of them? Yup, the differences are in the class name: module and module_menu. It is related with the CCS which is used by the active template. In order to get the same form menu, you can do such things like this:
- Open Module Manager through Extensions > Module Manager.
- Click the new menu name. In this training session, the new menu name is PHP Site. You will get the page to edit the menu (which is considered as module).
- Click Advanced Parameters.
- In the Class Suffix Module, fill with _menu.
- Click the Save button that is located in the upper toolbar.