News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

How to add favicon

Started by DAUCET, July 18, 2018, 05:23:42 AM

Previous topic - Next topic

DAUCET

Hello pls teach me Hoe to add favicon becayse I cant add favicon on my forum bountytalks.org [nofollow]

GigaWatt

1) If your host supports it (most hosts do nowadays), you just have to add the file favicon.ico in the root of your forum. The host should pick it up and load it in most browsers in a day or two.

2) If your host doesn't support favicons, your best bet would be this mod. If you install it on a theme that's not the default one (Curve), you'd have to do some manual edits too (it's explained in the thread and on the mod description page).
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Illori

this has nothing to do with hosts supporting it, it is a browser supported option. you dont need a mod to make a favicon work.

https://wiki.simplemachines.org/smf/Favicon.ico

@rjen

Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

GigaWatt

Quote from: Illori on July 18, 2018, 05:47:17 AM
this has nothing to do with hosts supporting it, it is a browser supported option. you dont need a mod to make a favicon work.

Hmmm... if that's so, how come it takes a day or two for the icon to actually load? I've tried emptying cache, private browsing... it still took about a day for the icon to show up.
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Gwenwyfar

That depends on caching. It should be up instantly, but if there is any cache for it, it may take even weeks to update from one to another, as favicons are heavily cached by the browser. There are a few ways you can force it to update in those cases, such as force refreshing the image directly (though this method will only work for you, and not the entire site).
"It is impossible to communicate with one that does not wish to communicate"

GigaWatt

What do you mean by "if there is any cache for it"? If I'm in private browsing, the cache for any site that's not already loaded in the private browsing window is clean, it should load every single file that the server has to offer, including the favicon if the browser asks for it.

I've also tried it in a VM, in Chrome, in FF on clean installs, Windows 7 and Windows 8.1, even FF on Xubuntu... nothing worked, it still needed about a day for most of them to show the favicon (I think all of them started showing the favicon after 2 days or so).

Maybe the real problem is that browsers don't actually ask for a favicon to be loaded on every single page load, but instead ask for it periodically (every 24 hours or so). But even if this was true, how come if I load a site that has a favicon in place for quite a while, the browser loads the favicon instantly, it doesn't take a few days for it to load ???.
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Gwenwyfar

I don't know about private browsing and favicons, but have in mind favicons don't get cached the same way as other images, and they are stored for a very long time. They also will not reset by a simple cache purge.

Maybe your server also had it's own caching in addition to the browser's, because there is no delay from the browser when adding a new favicon.
"It is impossible to communicate with one that does not wish to communicate"

GigaWatt

Quote from: Gwenwyfar on July 18, 2018, 08:34:01 AM
Maybe your server also had it's own caching in addition to the browser's, because there is no delay from the browser when adding a new favicon.

Ah, that might explain it ;). So basically, yes, it mostly depends on the browser, but also from the server itself. If it has caching enabled, it might take a while for it to pick up the favicon and load it ;).

So, since ico files can store multiple images (different resolutions and bit depths), what would be the safest option, i.e. what would work on most servers? I have mine set up as a two image ico file. Both of the images have a 16 x 16 resolution, but one has 16-bit color depth and the other has an 8-bit color depth. Would larger images embedded in the ico also work (for example a 32 x 32 icon with a 24-bit color depth)? Is this browser dependent or server dependent (deny loading the favicon if it doesn't meet certain parameters). And how many images can I have in the ico file? In Windows, bascially, there is no limit (with applications I mean), it loads the appropriate image from the resources when a certain view type is enabled... if an image is available for that particular view type ;).
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Gwenwyfar

You should use a favicon generator like the one @rjen linked above, because it's even more complicated than that ;)

And the server is not involved in anything at all (other than storing the images, of course).
"It is impossible to communicate with one that does not wish to communicate"

GigaWatt

I actually used IcoFX to generate the ICO file... made an icon in Corel, exported it in PNG, loaded it in IcoFX and saved it like I described... I thought that kind of export would be a safe bet since favicons are 16 x 16, so I didn't want to confuse the browser and/or server :P :D.

But I'll definitely try the favicon generator @rjen posted ;). Then, I'll open the file in IcoFX and see what types of images it has stored in it ;)... that way, I would know for certain what kind of images I can include in my favicons (I like doing things locally :)).
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Gwenwyfar

What most generators will do for you is save it in all the sizes the browser uses. In reality it gets more complicated than that because .ico is only the basic/primary file, so if you want to have the favicon looking good everywhere, you'll have to add other image types. Even .svg is possible in some browsers, though those generators don't tend to use it. There's also quirks with browser support, etc, which they already handle.
"It is impossible to communicate with one that does not wish to communicate"

GigaWatt

Quote from: Gwenwyfar on July 18, 2018, 09:10:47 AM
There's also quirks with browser support, etc, which they already handle.

What, they write some specific code in the ICO file to make it visible in all browsers, something that's not handled by offline ICO generator tools?

Hmmm... the version I have of IcoFX is a bit outdated, so I'll download a new one, see if the newer ones have an "ico for websites" setting or something :).
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Arantor

More like there are multiple files, some of which you point to in the HTML.

Advertisement: