Joomla! 1.5: Styling with CSS
Illustration by Richard Downs

Joomla! 1.5: Styling with CSS

with Jen Kramer

Video: Building image-based menus

As we promised from the last video, we would like to add some pictures to the Our Featured Products menu to make this menu just a little bit prettier and get some pictures on the Home page. First of all, we need to go to the backend of Joomla! and we need to configure our menu items to be associated with some pictures. Then we'll need to come back here to the Home page and do a little bit more styling. So let's go to the backend of Joomla! and let's go to Our Featured Products, which is in the Module Manager. Our Featured Products is the title of the module that's driving that menu. Inside of Our Featured Products, there is a setting under Other Parameters which says Show Menu Images. We're going to set this to Yes. That's all we need to do here to make this start to happen. Now click Save.

Start your free trial now, and begin learning software, business and creative skills—anytime, anywhere—with video instruction from recognized industry experts.

Start Your Free Trial Now
please wait ...
Watch the Online Video Course 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
Software:
Joomla!
Author:
Jen Kramer

Building image-based menus

As we promised from the last video, we would like to add some pictures to the Our Featured Products menu to make this menu just a little bit prettier and get some pictures on the Home page. First of all, we need to go to the backend of Joomla! and we need to configure our menu items to be associated with some pictures. Then we'll need to come back here to the Home page and do a little bit more styling. So let's go to the backend of Joomla! and let's go to Our Featured Products, which is in the Module Manager. Our Featured Products is the title of the module that's driving that menu. Inside of Our Featured Products, there is a setting under Other Parameters which says Show Menu Images. We're going to set this to Yes. That's all we need to do here to make this start to happen. Now click Save.

Now let's go to Menus and we're going to go to the home menu, which is the Our Featured Products menu on the home page. We're going to go into each of these menu items and within this editing screen on the right hand side there is a drop-down for the Menu Image. So for Hot Chocolate, we're going to choose homechoc.jpg from the drop-down and click Save. For Chocolate Truffles, we're going to go to hometruffles.jpg.

Finally for Pastilles, we're going to go to homepastille.jpg, and Save. Now let's refresh the Home page of the website and see how it looks. The images have been added to our menu and this doesn't look so bad, but I think we can clean it up and make it look just a little bit prettier. Let's go ahead and start editing the CSS for the Our Featured Products menu. Edit CSS, under default.css, let's scroll down to the right area, the right module styles. The first thing I want to do is get rid of that brown border around the whole box, I think, it's a little distracting. So I'm going to take out my border code for the h3 and I'm going to take out the borders that appeared for each of the individual links themselves.

Now I'm going to get rid of that padding again that I have around the entire link. What I would like to do is to have that image with the color not even showing around the image. I want it to look more like the picture on the end of a colored strip. So I'm going to scroll back up to my link in visited state where I have padding of five pixels and I'm going to get rid of that. Now what I would like to do is I would like to float the image that's here to the left and this will push my text up, all the way to the top of the image. Then we're going to need to add a little bit of padding to move it back down to the middle of the image. I would also like to add a little bit of margin to the side of my image, so that my words are smashed right into the edge of the image.

So to do this, I'm going to need to add another style. So for images in the div.moduletablehome, we would like them all to be floated left and we would like to add some margin. So now it's looking really funny and that's because we have these floats in place that we're floating the image and the text, and then we're floating the next image, and so forth. That's why this is looking a little bit odd.

Now we need to clear that up with our Clear Property. I'm going to add that Clear Property to our links in our visited state. Note the narrow color bar that I have associated with those. That's also a function of the float that's in place. So what I need to do is define a height to the links themselves and that will make the color bar, the same height as the image, if I pick the height of the image. To do that, all I have to do is right-click on the image and say Properties, and it will tell me that the dimensions for that image are 68 x 68 pixels.

So I'm going to make the height of my link and my visited link, 68 pixels. Now we have all of the color in place. So now all I need to do is make those white words appear towards the middle of the image. Remember that oddball span tag that we had inside of all of the HTML associated with this list. I'm going to use that to give me a little bit space on the top. So I'm going to take that span and the first thing I'm going to do is make it display as a block, which spans by definition our inline elements. So we need to make sure that we're going to display this as a block, otherwise we can't add any padding to it. Then I'm going to add some padding on the top, 25 pixels should do it. Now those are nicely aligned in the middle.

The very last thing I would like to do is the Our Featured Products title is pushed all the way over to the left and I would like to wind it up with all of the other words that are there in the menu. So the 'O' in "Our" lines up the 'H' in "Hot". So to my h3 style, which is just up here a little bit further, I'm going to alter the padding, so that we have 5 on the top, none on the right, 5 pixels on the bottom, and 78 pixels on the left. That's looking much better. Now all we have to do is copy these styles into Joomla! So once again, Ctrl+A or Command+A, Ctrl+C or Command+C to select everything and copy it. Then we're going to go to Extensions > Template Manager, the inside template, Edit CSS, default.css, and once again, Ctrl+A or Command+A, Ctrl+V or Command+V, and Save.

So now Our Featured Products is looking much more graphically oriented, and much prettier, and it has a larger draw for the eye to this webpage. You can use these individual styled links in combination with the image based menus or you can use them separately on your website. You don't have to have images only with individually styled links. You could, of course, put images on any of the menus on your website.

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.


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

* Estimated file size

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

Course retiring soon

Joomla! 1.5: Styling with CSS will be retired from the lynda.com library on March 19, 2015. Training videos and exercise files will no longer be available, but the course will still appear in your course history and certificates of completion.


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 ?

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.

Learn more, save more. Upgrade today!

Get our Annual Premium Membership at our best savings yet.

Upgrade to our Annual Premium Membership today and get even more value from your lynda.com subscription:

“In a way, I feel like you are rooting for me. Like you are really invested in my experience, and want me to get as much out of these courses as possible this is the best place to start on your journey to learning new material.”— Nadine H.

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.