# SVG file as favicon

I want to insert an svg file as favicon in Joomla. I have found the function addFavicon in Joomla core files (/libraries/joomla/document/html/html.php) which inserts the favicon link but I don't know how to use it and where in my template.

Thank you in advance for your answers.

## 1 Answer

I haven't tried using an SVG as a favicon, but the addFavicon function is part of the JDocumentHTML class, therefore you should use it like so:

$path = JUri::root() . 'templates/MY_TEMPLATE/file.svg';$type = 'image/svg+xml';
$rel = 'icon';$doc = JFactory::getDocument();
$doc->addFavicon($path, $type,$rel);

• Inserting the addFavicon function in the UpdateHead() function of my template did the trick. The page source now shows the html code for changing the favicon. – dfk_7677 Sep 14 '15 at 13:25