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

Building image-based menus

From: Joomla! 1.5: Styling with CSS

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.

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.

Show transcript

This video is part of

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

22 video lessons · 15875 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 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.