Updating website icon in Joomla 5

For the Cassiopeia template, Joomla will look for the favicons in the following locations:

  1. media/templates/site/cassiopeia/images – they are not there so Joomla will look in the next location.
  2. media/system/images – they are there so Joomla will use them from there.
wget -O - https://sharlines.com | grep -i favicon
        <link href="/media/system/images/joomla-favicon.svg" rel="icon" type="image/svg+xml">
        <link href="/media/templates/site/cassiopeia/images/favicon.ico" rel="alternate icon" type="image/vnd.microsoft.icon">
        <link href="/media/system/images/joomla-favicon-pinned.svg" rel="mask-icon" color="#000">

PHP source code:

// Browsers support SVG favicons
$this->addHeadLink(HTMLHelper::_('image', 'joomla-favicon.svg', '', [], true, 1), 'icon', 'rel', ['type' => 'image/svg+xml']);
$this->addHeadLink(HTMLHelper::_('image', 'favicon.ico', '', [], true, 1), 'alternate icon', 'rel', ['type' => 'image/vnd.microsoft.icon']);
$this->addHeadLink(HTMLHelper::_('image', 'joomla-favicon-pinned.svg', '', [], true, 1), 'mask-icon', 'rel', ['color' => '#000']);

2 Responses to Updating website icon in Joomla 5

  1. dmitriano says:

    What is the right way to change favicon.ico in Cassiopeia template?
    https://forum.joomla.org/viewtopic.php?f=834&t=1014569&p=3739455#p3739455

Leave a Reply

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