Favicon Selector Cannot Use Root /favicon.ico And Always Outputs ICO MIME Type For PNG/GIF Favicons - Question | JoomShaper

Favicon Selector Cannot Use Root /favicon.ico And Always Outputs ICO MIME Type For PNG/GIF Favicons

D

David Forés

Helix Framework 1 week ago

Hi JoomShaper team,

I’ve found two related issues with the favicon handling in Helix Ultimate. They’re small, but affect correctness and flexibility, so I wanted to report them clearly.


1. Favicon picker cannot select /favicon.ico in the site root

Issue

When I use the Template Options → Basic → Header → Favicon control, the file chooser only lets me select files under the /images path.

However, the classic and widely recommended location for a favicon is:

/favicon.ico

in the site root, not inside /images.

Current behavior

  • The favicon picker:
    • Only shows files under /images.
    • I cannot select /favicon.ico (even if it exists and is accessible).
  • As a result, if I want to use a root favicon, I have to:
    • Manually upload /favicon.ico via FTP or file manager.
    • Then work around it with custom code instead of using the built-in favicon option.

Expected behavior

At least one of these would solve it:

  1. Allow selecting files outside /images, especially /favicon.ico in the site root.
    Even just exposing /favicon.ico as a selectable option would be enough.
  2. Provide an optional text field in the favicon option to manually enter a path (e.g. /favicon.ico), instead of forcing selection via the media browser.

This would align Helix with the common pattern of having /favicon.ico in the root for maximum compatibility.


2. Wrong MIME type when favicon is not an ICO (PNG/GIF, etc.)

The label next to the favicon option says something like:

Upload a 48x48 .png or .gif image that will be your favicon.

So Helix explicitly encourages using PNG or GIF, not only .ico.

Current behavior

When I select a PNG as favicon (e.g. /images/favicons/favicon-96x96.png), the HTML output looks like this:

<link href="/images/favicons/favicon-96x96.png" rel="icon" type="image/vnd.microsoft.icon">

So:

  • The file is PNG (.png), but
  • The MIME type is image/vnd.microsoft.icon, which is the MIME type for ICO files.

This mismatch happens because Helix calls Joomla’s favicon API without specifying the correct MIME type for non-ICO files.

In Joomla core, the method is:

public function addFavicon($href, $type = 'image/vnd.microsoft.icon', $relation = 'shortcut icon')

When the second parameter is omitted, the default is image/vnd.microsoft.icon.
So if Helix does something like:

$doc->addFavicon($url); // no MIME type passed

then Joomla always treats it as an ICO, even if the file is actually a PNG or GIF.

Why this is a problem

  • The HTML is technically incorrect (PNG served with an ICO MIME type).
  • It can be confusing when debugging and is not standards-compliant.
  • Helix’s own label suggests using PNG/GIF, but the generated code doesn’t adapt.

Expected behavior

When the user selects a favicon path in Template Options, Helix should:

  1. Inspect the file extension (e.g. with pathinfo()), and
  2. Pass a matching MIME type to addFavicon().

Example (pseudo-code):

$path = $params->get('favicon'); // e.g. images/favicons/favicon-96x96.png

if ($path) {
    $url = Uri::root() . $path;
    $ext = strtolower(pathinfo($path, PATHINFO_EXTENSION));

    switch ($ext) {
        case 'png':
            $type = 'image/png';
            break;
        case 'gif':
            $type = 'image/gif';
            break;
        case 'jpg':
        case 'jpeg':
            $type = 'image/jpeg';
            break;
                ...
        default:
            // ico or anything unknown
            $type = 'image/vnd.microsoft.icon';
    }

    $doc->addFavicon($url, $type);
}

This way:

  • ICO files keep the current image/vnd.microsoft.icon type.
  • PNG/GIF/SVG/JPEG favicons get their correct MIME types.
  • The output matches what your UI suggests (a 48x48 PNG or GIF favicon is correctly declared as such).

Summary

Two small improvements would make favicon handling in Helix Ultimate much more robust and standards-friendly:

  1. Favicon selection

    • Allow selecting /favicon.ico in the site root (or provide a manual path field), not only files under /images.
  2. Correct MIME type

    • When a PNG/GIF/SVG/JPEG is used as favicon, pass the appropriate MIME type to addFavicon() instead of relying on the default image/vnd.microsoft.icon.

If you need any more details, screenshots, or tests on a specific Helix Ultimate / Joomla version, I’m happy to help.

0
1 Answers
Toufiq
Toufiq
Accepted Answer
Senior Staff 6 days ago #212543

Hi there,

Thank you for reaching out. I will share your suggestion to our developer team. Once, I've got update from our developer team, let you know.

Best regards,

Toufiqur Rahman (Team Lead, Support)

0