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

Styling banner ads

From: Joomla! 1.5: Styling with CSS

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.

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.

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.