Joomla 2.5 Templates – $this->template Updated on August 16, 2021 by Brad Markle 1 Minutes, 9 Seconds to Read In the Joomla 2.5 Beez2 template, we see the following PHP code in the index.php file: $doc->addScript($this->baseurl.'/templates/'.$this->template.'/javascript/md_stylechanger.js', 'text/javascript', true); In this tutorial, we will focus on $this->template. What is $this->template To find out what the value is of $this->template, we will update our template’s code as follows: $doc->addScript($this->baseurl.'/templates/'.$this->template.'/javascript/md_stylechanger.js', 'text/javascript', true); echo "<pre>" . $this->template . "</pre>"; die(); The output of the above is as follows: beez_20 We can see that $this->template holds the value of the template that we’re using, more specifically the folder name of the template. This information can be used to help build the path to files included within the template. For example, if we wanted our template to reference:https://domain.com/templates/beez_20/css/position.css … we can use $this->template to help build the url to position.css. Because we know that all Joomla 2.5 templates are located in the templates folder, the URL can be constructed dynamically. This is helpful because it won’t break our template if the user by chance moves Joomla to another folder on the server, or into a subfolder of the current domain. Share this Article Related Articles How to Use the Free Mini Frontpage Extension for Joomla 4.0 How to Change a Joomla 2.5 User’s Email Address How to Configure Joomla 2.5 to Send Email Using SMTP How to Edit a Joomla 3 Template How to install Phoca Gallery for Joomla 2.5 Creating a Menu Item for your Joomla 3 Component Changing Email Settings in Joomla 3.1 Using the Redirect Manager in Joomla 3.1 How to add Bootstrap to a Joomla 3.1 Template How to Use Bootstrap 5.0 Alerts in Joomla 4.0