linkedintwitterfacebookbranchout

sublogo
  • Our Services
  • Our Work
  • Who
  • Contact

Recent Blogs

  • Upgrade Joomla

  • How to design a Joomla website

  • What is Joomla?

  • Joomla Page Titles Module

  • Joomla FFmpeg Hosting

  • Working with Joomla

  • Social Networks and SEO

  • Blogging with Joomla

  • Joomla 1.7 For Web Sites

  • Custom Joomla Template Styling

  • Bespoke Custom Joomla Templates

  • Search Preview? You need it!

  • Introduction Articles in Joomla

  • Advertising Rules on Websites

  • Sef404 Virtuemart Pagination

  • Why Upgrade to IE9?

  • Expanding Joomla Content

  • Google's Goal

  • Meta Tags Help

  • E-Commerce Made Easy!

  • Joomla Installation

  • Joomla SEO Check

  • Improve your Joomla web site

  • Joomla htaccess re-write

  • Joomla Template Parameters

  • Email Safety

  • Create a hidden menu

  • Joomla1.6

Joomla Template Parameters

Details
Created on Sunday, 31 July 2011 11:42   |  
Written by The bloggers

In this Joomla tip we are going to look at adding a simple parameter to your Joomla template so that you have the option to select various background colours, or images to your site.

The first thing you are going to have to do is to download your template folder to your desktop or where ever you store your Joomla files.

Simply open up your ftp client, something  CuteFTP Pro or  fireFTP which is a  free plugin for Firefox. Enter your FTP details and connect to your server and browse your files and folders for templates -> mytemplatemname and download this folder.

Now we need to open the templateDetails.xml file with our html editor, something like dreamweaver and add the following:

<params>
<param type="spacer" default="Template Color" />
 <param name="colorVariation" type="list" default="default" label="Color Variation" description="Background variation to use">
 <option value="red">Red</option>
 <option value="blue">Blue</option>
 <option value="green">Green</option>
 <option value="orange">orange</option>
 </param>
<params>

If your current template does not have any template parmeters then simply place the above between these two lines like this:

</positions>
<params>
<param type="spacer" default="Template Color" />
 <param name="colorVariation" type="list" default="default" label="Color Variation" description="Background variation to use">
 <option value="red">Red</option>
 <option value="blue">Blue</option>
 <option value="green">Green</option>
 <option value="orange">orange</option>
 </param>
<params>
</install>

So what will this do? Well what we have just done here is to create the following options within our Joomla administration template settings.Note when writing the word colour (UK spelling) make sure you spell it color (US spelling) otherwise it will not work.

 

If you now upload the templateDetails.xml file back to your template folder and navigate to Extensions -> Template Manager and click on your template name you should now see the above template parameters. Yes? Great! But that is not it by any means what we need to do now is create some css style sheets and edit our index.php file.

Calling the style sheets through php

Open your index.php and look for the following tag </head> just before this add the following:

<link rel="stylesheet" href="/templates//css/backgrounds/.css" type="text/css" />

Great! Now save this and  upload the index.php back to your template folder.

Creating the style sheets

The best way to do this is to create a new folder within your templates css folder called backgrounds.

Now you can create a new css file  in dreamweaver of open notepad and add the following:

body{
 background: #237db0;
}

Now save this as blue.css into your backgrounds folder.

Repeat this step for all your different coloured style sheets and then upload the entire backgrounds folder to templates/css/

You should now be able to go to your Joomla administration and select the coloured background for your website from the template parameters and hay presto the colour has now changed.

This can also be done using images, you can simple create an image in photo shop or which ever image editor you have and instead of using background-color you could use this:

body{background: url('/../../images/tartan.jpg') repeat;}

This will repeat an image throughout the background of your template.

address

27 Levens Grove
Blackpool
Fy15PP
Lancashire
Tel: 01253 317504

Chat With a Joomla Expert

Features

  • Web Site Design and Development
  • Joomla Developers
  • Joomla Training Courses
  • E-commerce Sites
  • Web Site Promotion and Marketing

Clients

clients

  • Home
  • Blog
  • Terms and Conditions
  • Privacy Policy
  • Testimonials

 Copyright © 2006 - 2012 All Rights Reserved - Web Design Studio Limited -Tel: 01253 317504 - Mobile : 07896978967