Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Configuring menus and submenus

From: Joomla! 1.5: Creating and Editing Custom Templates

Video: Configuring menus and submenus

I am now looking at the Products page of the website and as you can see, this looks a little bit odd. What happened? What we have is some secondary navigation associated with Products, that would be these Bliss Bars and the Baking Chocolate and so forth. And right now, this is all folded in to the main menu. This is really the way you do want to build your Joomla! site. You want to include all of your secondary and tertiary navigation that's associated with some of these main menu items as a single menu bar. But it's not uncommon to want to break these into two pieces so that you have a horizontal main menu bar and a left hand secondary navigation bar.

Configuring menus and submenus

I am now looking at the Products page of the website and as you can see, this looks a little bit odd. What happened? What we have is some secondary navigation associated with Products, that would be these Bliss Bars and the Baking Chocolate and so forth. And right now, this is all folded in to the main menu. This is really the way you do want to build your Joomla! site. You want to include all of your secondary and tertiary navigation that's associated with some of these main menu items as a single menu bar. But it's not uncommon to want to break these into two pieces so that you have a horizontal main menu bar and a left hand secondary navigation bar.

So how do we go about doing this? Well, we are going to have to do a little bit of work with our modules. We are going to copy the Main Menu module and reconfigure it just to show the secondary navigation on the left side of the page and only on certain pages of this website. So let's do that now. We are going to go back to the back-end of Joomla! and we are going to go to Extensions > Module Manager and here we have a module for the Main Menu. We are going to copy it by placing a checkmark next to the name and hitting the Copy button.

So now we have a copy of Main Menu to work with. Click on the name and we are going to change then title of this to left navigation-products. We only have one left-hand navigation for this site but occasionally, you have more than one, so you want to make the name somewhat meaningful. We are going to enable it and we are of course not going to leave it in the top position, we want it on the left. Under the Menu Assignment, we only want this to appear on specific pages and those would be all of the pages that are associated with Products. To select these, simply select the first item, hold down your Shift key and click on the last item. If you wanted to click on other items that are not necessarily next to each other, hold down your Ctrl or Command key and click on those items. For example, if we wanted this navigation to show on the Privacy Policy page, but I don't want it to show up there. I just want it on the Products.

Let's look at the right side of the screen. This tells us that we have a menu from the Main Menu, which is correct. We have a Menu Style available to us and there are several styles that come with Joomla! but as you will see most of them are labeled Legacy. That's because most of these styles wrap a table around the navigation and I don't recommend you use any of those. Our list is very flexible for styling and making your menus do whatever you want. Then we have to Start and End Level. When they are both set to 0, this means show the entire menu, no matter how many levels of navigation you have. What we want to show is just the very top level of navigation. For this particular page, we want to start from the first level, we don't want to show the main navigation on the left side of the page, we just want to show the secondary navigation.

So we are going to start at 1 and end at 0, in other words, show all of the rest of the navigation, just not that very first level of navigation. The Always show sub-menu items would tell you that if there was a tertiary level of navigation to always show it, whether you are actually in that level of navigation or not. We are going to leave that to No. Go ahead and save this and we will take a quick peek at the progress on our website. I will go back to that front end the website and I am going to click the Refresh button and you will see now we have navigation that appears on the left hand side of the page but there's a secondary navigation is still present over here as part of the main navigation bar.

We have one more tweak we need to make to that Main Navigation module. So back to the back-end of Joomla! and let's go in to the Main Menu item. Once again, the problem lies with the Start and the End Level settings. So we are starting at level 0 and we are going to end at level 1. In other words we are just going to show 1 level of navigation. Click Save and we will go back and refresh this page and now it looks great. However, I would like to have my navigation show up ahead of the random image because I think it's going to be a little bit more usable to put my navigation first on the left hand column.

So I need to switch the order of the random image and the secondary navigation. Back to the back-end of this site. As you will recall from your Joomla! Essential Training course, you can use these arrows or the boxes with numbers to reorder how the modules will appear in a certain region of your webpage. We want to switch the position of the left navigation and the random image so that left navigation comes first and random image comes second. I am just going to click this arrow to move the random image down and sometimes this doesn't work. That's because these are assigned the same number. If you change the numbers, I want left navigation first and I want the random image second, then click the small disk icon to save the order; that will correctly order things in the list. Let's refresh the Products page. Now things are looking much better.

One last tweak I would like to make to both of my menus is I would like the navigation for the page that I am currently on to look slightly different than the rest of the navigation for the webpage. I am going to switch over to the Bliss No. 5 Bars page and this is actually in the wrong order as well, so let's fix that. I would like my navigation to appear above the poll. So once again, I am going to click my arrows to move up my left navigation and we will refresh the page, now my navigation is above the poll.

What I would like to have happen is I would like to have the word Products look slightly different than every other word in this main navigation bar. I don't like to have the words Bliss No. 5 Bars again look different than the other items in the secondary navigation list because Joomla! writes lots and lots of classes and ids into their menu code. We can easily do this. Let's view the source of the webpage and I am going to scroll down to Products, which is right here and if we take a look at the code that comes right before that, it starts here at the li class. We have three items to choose from, a class of parent, a class of active or a class of item2.

Active is the one that we can style for the you are here type of marker. So let's go ahead and write that CSS first. We are going to go into CSS > Edit CSS in our default tab and up here in the header code, I am going to add another style, header li.active a:link, so in other words this is within the div called header with the li that has a class of active and within all links, as well as header li.active a: visited. I want to do the following.

I am just going to change the color with that same chocolate brown we have on this website. So our color will be 46311c and you can see that the color changed immediately here on the web page. Let's do the same thing to the left hand side of the page. Let's view the html and let's find the Bliss No. 5 Bars over in the left hand navigation, which is here, and you will see that once again we have a class of active associated with the li. So let's use that to write an style to make these words Bliss No. 5 Bars turn white, when that is the active page. So #left li.active a:link, as well as #left li.active a:visited and let's make the color here, white. That's looking terrific.

Now what we have to do is copy and paste this into our Joomla! template. Ctrl+A or Command+A to select everything. Ctrl+C or Command+C to copy, back over to our back-end of Joomla!, Extensions > Template Manager, inside, Edit, Edit CSS, default css, Edit and once again, Ctrl+A or Command+A, Ctrl+V or Command+V to paste and save. And let's refresh our page and see if those changes have taken.

Now we have some terrific 'You are here' navigation. We have really cleaned up the look of this webpage quite a bit. Splitting up your navigation to a main navigation and a side navigation bar is the technique used on millions of websites throughout the Internet and it's easy to set up in Joomla!. Use this same type of organization on your site so that users can get around them very easily.

Show transcript

This video is part of

Image for Joomla! 1.5: Creating and Editing Custom Templates
Joomla! 1.5: Creating and Editing Custom Templates

25 video lessons · 23015 viewers

Jen Kramer
Author

 

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now "Already a member? Log in

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Joomla! 1.5: Creating and Editing Custom Templates.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.