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


From:

Joomla! 1.5: Styling with CSS

with Jen Kramer

Video: Styling banner ads

Banner ads are a common addition to many websites today and Joomla! has a great built-in banner ad functionality. I am going to show you how to set up some banner ads for your own website and then we are going to style them just a little bit to make them look a little bit better on our webpage. So I am going to hop into the back end of Joomla! and I am going to go to the Components > Banner > Categories. Now banner ads have two pieces in Joomla!. You actually configure the banner ads themselves within the Components area and then under the Module Manager there is a module that determines where that banner ad will actually be displayed. The idea is that you can have several banner ads that rotate in the same position, so that when you refresh the page a different banner ad will come up.

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

Banner ads are a common addition to many websites today and Joomla! has a great built-in banner ad functionality. I am going to show you how to set up some banner ads for your own website and then we are going to style them just a little bit to make them look a little bit better on our webpage. So I am going to hop into the back end of Joomla! and I am going to go to the Components > Banner > Categories. Now banner ads have two pieces in Joomla!. You actually configure the banner ads themselves within the Components area and then under the Module Manager there is a module that determines where that banner ad will actually be displayed. The idea is that you can have several banner ads that rotate in the same position, so that when you refresh the page a different banner ad will come up.

First you have to establish a category for your banner ad. So I am going to add this category. We can call it anything you want but I am going to call it the left banner ad. Once our Category is established we can establish a client. And my client is going to be lynda.com. So we need to complete the Client Name, the Contact Name and the Contact Email Address. There is a box over here for putting any extra information that you may want to save about this banner client in your website. But I am not going to add anything at this point. Then hit Save. Now we are ready to configure individual banners.

Earlier in the Media Manager there is a folder here called banners and inside of the banners folder, and if you are running the Exercise File these images should be there, we uploaded three separate lynda.com images which we are going to use as our banner ad for the website. These are all the same dimensions and vary really only in the background color. I am going to back to Components > Banner > Banners. I am going to click New and I have to give my banner a name. So first I am going to put together the black ad, which I am just going to call lynda black. I do want it to show. Sticky has to do with whether that banner ad is going to stick at the top of the rotation or not. And I am going to set that to No. We have to assign it a Category as well as a Client Name.

If you are in the business of selling banner ads here is where you can type in how many Impressions you want to show on the website. I am just going to leave mine to Unlimited though. Then we are going to type in the click URL. In other words when you click the banner where do you go? Which we are just going to the lynda.com homepage. There is space here for custom banner code, if you have any JavaScript or any other code that you need to go with it, and space for Notes, which might be handy to document that code that you put in that box.

Finally we are going to select our banner image from the list and we have three to choose from here, the black, the white, and the yellow. So I am going to pick the black. A small preview pops up here on the bottom. You can assign a width and height but I am going to do that in CSS elsewhere and there is a Tag functionality here that we are not going to use on this particular website. Now I am going to save. Rather than retyping all of those settings for the other two banner ads I am just going to check next to lynda black and I am going to copy and I am going to copy again and then I am just going to modify my copies with the other information for the other banner ads. So I am going to change the name here of this one to lynda gold. I do want the banner to show.

I am going to erase the alias. It will put in an alias for me later. And all the rest of this information remains the same until I get to the bottom. This time I am going to pick the Y or yellow version of the banner ad and I will save. And finally in my last copy this will become the lynda white ad. Now I will get rid of the alias. Yes, I want the banner to show and then skip to the bottom where I will set this to white. So now I will save. The next thing I need to do is create a module for my banner ad. So I am going to go to Extensions under the Module Manager and I am going to click the New button to make a new module.

This will be a type of banner and as you see a note here, the Banner module allows you to show the active banners out of the component within your site. So I am going to put in a title, banner ad. I don't want that title to show though. I do want it enabled and I want it on the left side of the page. I am specifically going to put it on my Products pages and once again I held down my Shift key to select all of the items under Products. On the right side of the page I would like this to open in a new window with browser navigation. I want one banner ad to show at a time.

My banner client is lynda.com and the Category is left banner ad. I am not going to use the Search by Tags functionality and I do want this to Randomize. So I am going to switch this to Sticky, Randomize. That's pretty much all we're going to need to do. So let's save this and we will go back to the front end of our website and refresh. So now you can see our banner ad down here in the bottom of the page. But it's kind of shoved all the way far to the left side of the page and if I outline all of the block level elements, you will see that this is inside of a div that extends the whole width of the page.

So what I need to do is make the div a little bit narrower and then put in some padding on the left side to push this over to make the edge of the banner ad even with the secondary navigation. I am going to refresh to get rid of the outlines. So now we are going to go to CSS > Edit CSS, Default and I am going to put this in the left area of our style sheet. So here under Left, I am going to put in left div.moduletable because that's the code that's surrounding my banner ad. I am going to set the width to 162 pixels and then I am going to put in some Padding. Let's put 3 ems on the top and let's put 40 pixels on the left.

That gives us a little bit of breathing room between the secondary navigation and the left edge of the banner ad is nicely in line with the left of the secondary navigation. Now all I have to do is drop this CSS into my Joomla! style sheet. Ctrl or Command+A to select everything, Ctrl or Command+C to copy. Now I am going to go to the back end of the website to Extensions > Template Manager, the inside template, Edit > Edit CSS, default.css, Edit, Ctrl or Command+A to select everything. Ctrl or Command+V to paste, and save. Now when I go back to the front end of my website and refresh you will see that the banner ad is in its new position and every time I refresh I get a different a banner ad.

Occasionally I will get the same one twice in a row. And that's just the nature of choosing a random banner. So banners just sometimes are a necessary evil for a website but Joomla! makes them really easy to set up and easy to keep track of how many impressions have been served up to the website and how many click-throughs you get. Don't be afraid to experiment with finding the right spot on your website for this banner ad. I think this is working pretty well down on the lower left but you could have tried it in the top or even in the footer.

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.