New Feature: Playlist Center! Pick a topic and let our playlists guide the way.

Start learning with our library of video tutorials taught by experts. Get started

Joomla! 1.5: Styling with CSS
Illustration by

Styling menus vertically


From:

Joomla! 1.5: Styling with CSS

with Jen Kramer

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.

Watch this entire course now—plus get access to every course in the library. Each course includes high-quality videos taught by expert instructors.

Become a member
please wait ...
Joomla! 1.5: Styling with CSS
2h 29m Intermediate Jan 09, 2009

Viewers: in countries Watching now:

Joomla! 1.5: Styling with CSS shows how those familiar with Joomla! and with hand-coded HTML and CSS can take the next step in creating a dynamic website with a unique look and feel. Jen Kramer McKibben goes deep into the functionality of this open-source content management system, exploring topics like putting more style into modules, editing CSS on the fly using the Firefox Web Developer toolbar, creating horizontal and vertical menu layouts, and including images in those menus. Exercise files accompany the course.

Topics include:
  • Using the Firefox Web Developer toolbar
  • Styling Joomla! modules
  • Styling a multi-page article
  • Creating horizontal and vertical menus
  • Incorporating images in menus
  • Styling banner ads
Subjects:
Developer Web CMS Web Development
Software:
Joomla!
Author:
Jen Kramer

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.

Find answers to the most frequently asked questions about Joomla! 1.5: Styling with CSS.


Expand all | Collapse all
please wait ...
Q: I’m having trouble understanding the role of the Start Level/End Level function in developing a menu, as described in the  “Styling Menus Vertically” video.  What is the key to understanding this function?
A: The Start Level and End Level are the way a menu is segmented, to show all or part of that menu.

By default, the Start Level and End Level are set to 0. This means that the entire menu will show.

If you would like to have just the top level navigation show (perhaps for a top menu bar), but none of the secondary, tertiary, or deeper navigation, set Start Level to 0 and End Level to 1.

If you would like to have just the secondary navigation show (i.e. you're in the "about" portion of the site and you'd like to have the about secondary navigation show on the left side of the page), set the Start Level to 1 and the End Level to 2. If you'd like to show all of the navigation (secondary, tertiary, and any deeper navigation), set the Start Level to 1 and the End Level to 0 (i.e. infinite).

The only tricky part about setting the Start and End Levels is that zero means different things in different locations.

For the Start Level, zero means the very beginning of the navigation. Engineers start counting with zero, while we are normally taught to start counting with 1, so this may be the cause of some confusion.  This means that 1 actually corresponds to the second level, 2 to the third level, and so forth.

For the End Level, zero indicates "infinity", or however far out the navigation goes.
 
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.
Upgrade now


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 Upgrade now

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

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.