12 Oct 2015

Adding a favicon to the Joomla T3 framework

One of the annoying bugs of the T3 framework is that it over writes the favicon everytime the framework is updates. To fix this, upload the favicon outside of your template directory. In decided to upload it directly into th root template folder.

Firstly, I put the variable $path at the top of the head. This is only neccassary if you want to dynamically insert the URL - But it's handy to do so, and I suggest you do, otherwise you would have to type the full absolute path.

<?php
$app = JFactory::getApplication();
$path = JURI::base(true).'/templates/'.$app->getTemplate().'/';
?>

 

Put the following into the head block, but make sure it comes after the call to load the T3 head:

<link rel="shortcut icon" href="<?php echo $path; ?>../favicon.ico" />

 

My head block looks something like this:

<?php
// T3 BASE HEAD
$this->addHead();
?>

<link rel="shortcut icon" href="<?php echo $path; ?>../favicon.ico" />