Back to Top

How to use Template Parameter in Joomla

Here is one quick article about to use Template Parameter in Joomla.You can change the functionality of template with the use of template parameters which you can set from admin panel.Parameters are an excellent way to make your template more flexible.

In Admin panel, default templates are included in the system and can use them.By adding code into the template file, you can retrieve the current value of the parameter.

In Joomla, We can configure component display functionality from template file with using the get method.

In index.php, To retrieve template parameters by following line of code:


params can be used to get and set parameters.params is automatically accessible in the global scope. This object has the member function get() which returns the parameter value given the name

Let’s have a look one example for the template parameter.

Here, Let’s see whether you want to load Show Back to Top Button in the template file or not.You can add an option for same by placing code into params.ini,templateDetails.xml file and then you can retrieve a value in the template file.

Step 1: TemplateDetails.xml

First of all, Let’s add parameters into the templateDetails.XML file by using the following line of code.

No Yes

The templateDetails file can contain template parameters which can change the functionality of template. As Here, I have set that want to display MooTools library or not.

Step 2: Params.ini

Next, Lets stored the parameter in the file params.ini located in the folder of each template by adding following line of code into the params.ini file.


Step 3: Template File

Now, Parameters can be accessed from within the template by using code such as

if ($this->params->get('showTopbutton') == "true") {
	// Desire code to load top button

Must Read:

Custom Query with Joomla
To disable component on front page in Joomla
To view Position in Joomla 2.5

That’s it.I hope this post will help you. Don’t Forget to Follow us on Twitter or Subscribe us to Get the Latest Updates.

Comments (2)

  1. Great Tutorial, it saves me a lot of brain-storming…

  2. What’s up i am kavin, its my first occasion to commenting anyplace, when i read this post i thought
    i could also create comment due to this sensible post.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Most Popular Posts

How to use Change DB Prefix Plugin

Posted on 7 years ago


Understanding CSS3 Pseudo-elements

Posted on 3 years ago


How to use Replace function in MySQL

Posted on 7 years ago


What is Type Hinting in PHP5

Posted on 7 years ago


Hello world

Updated 1 month ago

Nick Carter

In depth Understanding of Laravel Core

Updated 3 months ago


ECMAScript 6 New Features – 2

Updated 1 year ago


The Reader’s Poll – June 2015

Posted on 4 years ago


The Reader’s Poll – August 2014

Posted on 5 years ago


The Reader’s Poll – June 2014

Posted on 5 years ago


The Readers’ Poll – May 2014

Posted on 5 years ago


The Readers’ Poll – August 2013

Posted on 6 years ago