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

Styling menus vertically

From: Joomla! 1.5: Styling with CSS

Video: Styling menus vertically

Our horizontal navigation is looking great but if you go to the PRODUCTS page, you'll see that our secondary navigation now leaves something to be desired. What's happening here is PRODUCTS is our selected item on the navigation bar and then it's putting all of our secondary navigation in a horizontal manner as well, followed by the rest of that primary navigation bar. What do we need to do now is separate these so that the secondary navigation stands alone on the left side of the page. When we are done, the page will look like this.

Styling menus vertically

Our horizontal navigation is looking great but if you go to the PRODUCTS page, you'll see that our secondary navigation now leaves something to be desired. What's happening here is PRODUCTS is our selected item on the navigation bar and then it's putting all of our secondary navigation in a horizontal manner as well, followed by the rest of that primary navigation bar. What do we need to do now is separate these so that the secondary navigation stands alone on the left side of the page. When we are done, the page will look like this.

So the first thing that we need to do is we need to split this main navigation bar into a bar that'll go across the top of the page only and the secondary navigation, that will live on the left side of this page. You might think an easier way to approach this is to simply create another navigation bar for the secondary navigation for this page. The problem is as you go further into the site the breadcrumb, which is here above the word Products, will not work correctly. In that case, instead of saying, Home> Products>Hot Chocolate, it would simply say Home>Hot Chocolate and not really reflect the correct navigation path for the website. So let's go into the backend of the website, we're going to go to Extensions > Module Manager, and we're going to make a copy of our Main Menu.

We're going to put a check mark next to Main Menu and click the Copy button. In our copy of Main Menu, we're going to change some of the settings. Instead of it being, Copy of Main Menu, I am going to make this the Products Menu. So I will know what this is and I am going to enable it, although I won't show the title. I would like this to appear on the left side of the page. I would also like it to appear only on certain web pages, specifically those related to the products. So I am going to switch to Select Menu Item(s) from the List, select Products and that entire section. I am holding down the Shift key to select multiple items at once. Over on the right side of the page, we have a Start and an End Level. These are critical settings for putting together the menu. If I start at 0 and end at 0, this will give me the full menu; but what I really want is just the secondary navigation associated with the Products section.

So I am going to start at level 1 and end at level 0, meaning that I want everything that's not the primary navigation to show up on the left side of the page. So let's hit Save and let's see what happens. Now you'll see the navigation bar has, in fact, showed up on to the left side of the page. However, we still have the problem with our main navigation bar. That's because we need to change those Start and End settings inside of the Main Menu module.

Back to the backend of the website, go to Main Menu, our Start Level will be 0 but our End Level will be 1. In other words, show only the primary navigation for the Main Menu. Click Save. Now let's go back to the front and click Refresh. So our main navigation bar looks exactly the way it did on Home page and we have our left navigation in place, on the left side of the page. Now we need to add a little bit of style to that left navigation.

Once again, we will go to CSS > Edit CSS, and switch to the default style sheet, scroll down to the left module styles area. First of all, we need to get rid of the bullets. So in the left div for ul, once again, we go and set our list-style-type to none. Now we can just style the links that are left. I like the padding that's there. Notice how nicely it lines up with 'H' in Home. So I don't really need to turn off the margin or the padding associated with this list.

So now we'll style the actual links themselves. So for the links located in an unordered list, in both the unvisited and visited states, I would like them to be of certain color. This is a teal color. I would like to get rid of that underline, by setting the text- decoration to none and I would like them to be bold. We can also set a hover state. I've set that to white. Now when we hover over the links, they'll also change color.

Finally, we may want to add that "you are here" type of feature that we have on our top navigation, under Products. So if I am on one of these pages, such as the Product Sampler or the Hot Chocolate page, I would like to see those words appear white. I am going to put that right above my hover because again, remember that your link styles must be in the order of link, visited, hover, and active. Once again, we're going to work with the active state of the li, just like we did on the previous menu. What we need to do is set the color to white. We're not going to see the active state in our left navigation on this particular page because there is no link corresponding to this page in the left navigation, but once we transfer this code to our Joomla! template, we'll take a look again at one of the other pages and make sure that this code is working correctly.

So once again, I am going to click Ctrl +A or Command+A, Ctrl+C or Command+C. Then go back to the backend of the website, go to Extensions > Template Manager, inside, Edit, Edit CSS, default.css, Edit, and then once again Ctrl+A or Command+A, Ctrl+V or Command+V and save. Back to the front and on to the website and Refresh, and that's looking much better. Our hover is working great and when I go to the Product Sampler page, you see that the link here, on the left hand side, is white. PRODUCTS in the top navigation is brown, indicating where we are in the hierarchy.

Now we're going to take a look at the Hot Chocolate page. Hot Chocolate has some tertiary navigation and it looks a little bit off to me. We're not on all four of these pages at the same time. I really only want to be on the Hot Chocolate page or the Caramel Chocolate page. So we're going to need to adjust this navigation a little bit more, which we'll do in the next few movies.

Show transcript

This video is part of

Image for Joomla! 1.5: Styling with CSS
Joomla! 1.5: Styling with CSS

22 video lessons · 15894 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: Styling with CSS.

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 preferences from 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.

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.