In this part 2 of Creating A Custom Joomla Template, we're going to add a logo and a navigation bar (menu bar).

IMPORTANT: This tutorial assumes that you are coming from PART 1 and that you have a 'clean' install of Joomla! with no sample data added (How To Install Joomla In WAMP Server).

You can find PART 1 of this tutorial here:

STEP 1: Add A Logo

What's a website without a logo, so that's the first thing we'll do:

  1. Create a logo for your website.
    • It should be 350x70 pixels (WxH).
    • If you want to use the generic one a created for this tutorial (shown below), click here to download it: Logo.
Creating A Custom Joomla Template (Part 2)
  1. Name the image "logo". The image extension can be a .png or a .jpg image extension.
  2. Place the logo in here: /templates/mytemplate/images (where mytemplate is the name ofyour template).
  3. Add the logo image to the header section of your template's index.php page. Here's the image element code:
    • <img class="logo-image" src="/templates/mytemplate/images/logo.png" />.
    • Change the mytemplate to the name of your template.
    • If your logo image has a .jpg extension, then make sure the code snippet you add to your template reflects that.

In your template's index.php file, this:

<!-- start header -->
  <div class="header">
    <!-- something goes here -->
  </div>
<!-- end header -->

Should now look like this:

<!-- start header -->
  <div class="header">
    <img class="logo-image" src="/templates/mytemplate/images/logo.png" />
  </div>
<!-- end header -->

Notice that the the image element has the class name of logo-image. This will help us style the logo in PART 3 of this tutorial.

STEP 2: Add The Navigation Bar

In your template's index.php file, you'll find the following line of code <jdoc:include type="modules" name="navigation" />.

<!-- start nav bar -->
<div class="navigation">
  <jdoc:include type="modules" name="navigation" />
</div>
<!-- end nav bar -->

This is the position where the navigation bar will appear in your site's web pages.

To get the navigation bar to appear in that position, you need to set the Main Menu module's position to the navigation position in your website's administrator's control panel.

Let's do that now:

Creating A Custom Joomla Template (Part 2)
  1. Log in to your administrator's control panel (if you haven't already).
  2. Go to Extensions->Modules.
  3. The Modules (Site) panel will now load.
Creating A Custom Joomla Template (Part 2)

On the Modules (Site) panel, you'll notice 3 selections:

Creating A Custom Joomla Template (Part 2)
  1. Click on the Main Menu option (click on the name itself).
  2. The Main Menu Modules: Menu panel will now load.
Creating A Custom Joomla Template (Part 2)
  1. On the right side of the panel, you'll see a parameter with the name of Position.
Creating A Custom Joomla Template (Part 2)
  1. Click on the x next to the position-7 name.
  2. The position-7 name will be removed.
  3. Click on the down arrow. You'll now see a drop-down list of positions from all of the installed templates in your Joomla! website.
Creating A Custom Joomla Template (Part 2)
  1. Scroll down the list till you come to the mytemplate heading (where mytemplate is the name of your template).
  2. Select the Navigation [navigation] option.
  3. Click the Save & Close button at the top of the Main Menu module panel (see image below).
Creating A Custom Joomla Template (Part 2)

You have now added the Main Menu module (which is the navigation bar) to your website's pages.


STEP 3: Add Menu Items To Main Menu (Navigation Bar)

We're now gonna' add menu items to the Main Menu.

For this tutorial, I'm going to have you add 2 menu items. One will be named Cars and the other will be named Bicycles.

Bear with me and name your menu items the same names. Once you learn how to create a menu item, you can go back and change the names.

Creating A Custom Joomla Template (Part 2)
  1. Go to Menus->Main Menu.
  2. The Menus: Items (Main Menu) panel will now load.
Creating A Custom Joomla Template (Part 2)
  1. Click on the green New button (in the tool bar).
  2. The Menus: New Item panel will now load.
Creating A Custom Joomla Template (Part 2)

In the Menus: New Item panel, configure the following:

  1. Menu title * - type Cars in the text box.
  2. Alias * - type cars in the text box.
  3. Menu item type * - click on the blue Select button (see image below).
Creating A Custom Joomla Template (Part 2)
  1. The Menu Item Type modal window will now open.
Creating A Custom Joomla Template (Part 2)

In the Menu Item Type modal window:

  1. Click on the Articles option.
  2. The Articles accordion will now open.
  3. Click on the Category blog option.
  4. The modal window will now close.
Creating A Custom Joomla Template (Part 2)

On the Choose a Category * option, you'll now notice that a Create button has been added.

  1. Click on the Create button.
  2. The New Category modal window will now open.
Creating A Custom Joomla Template (Part 2)

In the New Category modal window, add the following:

  1. Title * - type Cars in the text box.
  2. Alias - type cars in the text box.
  3. Click the blue Save & Close button.
  4. You'll now be returned to the Bicycle Menus: Edit Item panel.
Creating A Custom Joomla Template (Part 2)
  1. Click on the Save & Close button at the top of the panel (see image above).
  2. You'll now be returned to the Menus: Items (Main Menu) panel.

STEP 4: Add A Second Menu Item

We're now gonna' add a second menu item. Instead of creating one from scratch, we're going to copy the existing Cars menu item.

These are the steps:

Creating A Custom Joomla Template (Part 2)
  1. In the Menus: Items (Main Menu) panel (Menus->Main Menu).
  2. Click on the Cars menu item name (see image above).
  3. The Cars Menus: Edit Item panel will now load.
Creating A Custom Joomla Template (Part 2)

In the Cars Menus: Edit Item panel:

Creating A Custom Joomla Template (Part 2)
  1. Click the Save as Copy button.
  2. The panel will reload and you'll notice that the Menu Title * and the Alias name have a number 2 added.
Creating A Custom Joomla Template (Part 2)
  1. Rename the Menu Title * from: Cars (2) to: Bicycles.
  2. Rename the Alias from: cars-2 to: bicycles.
  3. On the Choose a Category * option, click on the X Clear button.
Creating A Custom Joomla Template (Part 2)

You'll now see that the Choose a Category * parameter will revert to its default options:

Creating A Custom Joomla Template (Part 2)
  1. Click on the Create button.
  2. The New Category modal window will now open.
Creating A Custom Joomla Template (Part 2)

In the New Category modal window, add the following:

  1. Title * - type Bicycles in the text box.
  2. Alias - type bicycles in the text box.
  3. Click the blue Save & Close button at the bottom of the modal window.
  4. You'll now be returned to the new Bicycles Menus: Edit Item panel.
Creating A Custom Joomla Template (Part 2)

In the Bicycles Menus: Edit Item panel, find the Status parameter (it's on the right side of the panel):

Creating A Custom Joomla Template (Part 2)
  1. Click on the red Unpublished selection.
  2. You'll now see a drop-down list appear (see image below).
Creating A Custom Joomla Template (Part 2)
  1. Click on the Published option of the list.
  2. The Status parameter will now be set to a green Published state.
Creating A Custom Joomla Template (Part 2)
  1. Go to the top of the panel and click on the Save & Close button.

Check The Front Page

If all went according to plan, go to the front page of your Joomla! website and you should see the following page:

Creating A Custom Joomla Template (Part 2)

Not much to look at, but it's getting there!