Start learning with our library of video tutorials taught by experts. Get started
Viewers: in countries Watching now:
Custom templates are the key to making a Joomla!-driven website stand out. In Joomla! 1.5 Creating and Editing Custom Templates, Jen Kramer McKibben offers instruction and insight to help Joomla! users create eye-popping websites. Jen starts with the basics, like how to add the Joomla! template codes to a static HTML layout, install the template package, and clean up styling after installation. She also shows how to make multiple layouts within the same Joomla! template, configure menus and submenus, and more. Exercise files accompany the course.
I am now looking at the Products page of the website and as you can see, this looks a little bit odd. What happened? What we have is some secondary navigation associated with Products, that would be these Bliss Bars and the Baking Chocolate and so forth. And right now, this is all folded in to the main menu. This is really the way you do want to build your Joomla! site. You want to include all of your secondary and tertiary navigation that's associated with some of these main menu items as a single menu bar. But it's not uncommon to want to break these into two pieces so that you have a horizontal main menu bar and a left hand secondary navigation bar.
So how do we go about doing this? Well, we are going to have to do a little bit of work with our modules. We are going to copy the Main Menu module and reconfigure it just to show the secondary navigation on the left side of the page and only on certain pages of this website. So let's do that now. We are going to go back to the back-end of Joomla! and we are going to go to Extensions > Module Manager and here we have a module for the Main Menu. We are going to copy it by placing a checkmark next to the name and hitting the Copy button.
Let's look at the right side of the screen. This tells us that we have a menu from the Main Menu, which is correct. We have a Menu Style available to us and there are several styles that come with Joomla! but as you will see most of them are labeled Legacy. That's because most of these styles wrap a table around the navigation and I don't recommend you use any of those. Our list is very flexible for styling and making your menus do whatever you want. Then we have to Start and End Level. When they are both set to 0, this means show the entire menu, no matter how many levels of navigation you have. What we want to show is just the very top level of navigation. For this particular page, we want to start from the first level, we don't want to show the main navigation on the left side of the page, we just want to show the secondary navigation.
So we are going to start at 1 and end at 0, in other words, show all of the rest of the navigation, just not that very first level of navigation. The Always show sub-menu items would tell you that if there was a tertiary level of navigation to always show it, whether you are actually in that level of navigation or not. We are going to leave that to No. Go ahead and save this and we will take a quick peek at the progress on our website. I will go back to that front end the website and I am going to click the Refresh button and you will see now we have navigation that appears on the left hand side of the page but there's a secondary navigation is still present over here as part of the main navigation bar.
We have one more tweak we need to make to that Main Navigation module. So back to the back-end of Joomla! and let's go in to the Main Menu item. Once again, the problem lies with the Start and the End Level settings. So we are starting at level 0 and we are going to end at level 1. In other words we are just going to show 1 level of navigation. Click Save and we will go back and refresh this page and now it looks great. However, I would like to have my navigation show up ahead of the random image because I think it's going to be a little bit more usable to put my navigation first on the left hand column.
So I need to switch the order of the random image and the secondary navigation. Back to the back-end of this site. As you will recall from your Joomla! Essential Training course, you can use these arrows or the boxes with numbers to reorder how the modules will appear in a certain region of your webpage. We want to switch the position of the left navigation and the random image so that left navigation comes first and random image comes second. I am just going to click this arrow to move the random image down and sometimes this doesn't work. That's because these are assigned the same number. If you change the numbers, I want left navigation first and I want the random image second, then click the small disk icon to save the order; that will correctly order things in the list. Let's refresh the Products page. Now things are looking much better.
One last tweak I would like to make to both of my menus is I would like the navigation for the page that I am currently on to look slightly different than the rest of the navigation for the webpage. I am going to switch over to the Bliss No. 5 Bars page and this is actually in the wrong order as well, so let's fix that. I would like my navigation to appear above the poll. So once again, I am going to click my arrows to move up my left navigation and we will refresh the page, now my navigation is above the poll.
What I would like to have happen is I would like to have the word Products look slightly different than every other word in this main navigation bar. I don't like to have the words Bliss No. 5 Bars again look different than the other items in the secondary navigation list because Joomla! writes lots and lots of classes and ids into their menu code. We can easily do this. Let's view the source of the webpage and I am going to scroll down to Products, which is right here and if we take a look at the code that comes right before that, it starts here at the li class. We have three items to choose from, a class of parent, a class of active or a class of item2.
Active is the one that we can style for the you are here type of marker. So let's go ahead and write that CSS first. We are going to go into CSS > Edit CSS in our default tab and up here in the header code, I am going to add another style, header li.active a:link, so in other words this is within the div called header with the li that has a class of active and within all links, as well as header li.active a: visited. I want to do the following.
I am just going to change the color with that same chocolate brown we have on this website. So our color will be 46311c and you can see that the color changed immediately here on the web page. Let's do the same thing to the left hand side of the page. Let's view the html and let's find the Bliss No. 5 Bars over in the left hand navigation, which is here, and you will see that once again we have a class of active associated with the li. So let's use that to write an style to make these words Bliss No. 5 Bars turn white, when that is the active page. So #left li.active a:link, as well as #left li.active a:visited and let's make the color here, white. That's looking terrific.
Now what we have to do is copy and paste this into our Joomla! template. Ctrl+A or Command+A to select everything. Ctrl+C or Command+C to copy, back over to our back-end of Joomla!, Extensions > Template Manager, inside, Edit, Edit CSS, default css, Edit and once again, Ctrl+A or Command+A, Ctrl+V or Command+V to paste and save. And let's refresh our page and see if those changes have taken.
Now we have some terrific 'You are here' navigation. We have really cleaned up the look of this webpage quite a bit. Splitting up your navigation to a main navigation and a side navigation bar is the technique used on millions of websites throughout the Internet and it's easy to set up in Joomla!. Use this same type of organization on your site so that users can get around them very easily.
Find answers to the most frequently asked questions about Joomla! 1.5: Creating and Editing Custom Templates.
Here are the FAQs that matched your search "":
Sorry, there are no matches for your search ""—to search again, type in another word or phrase and click search.
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
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.