Log in

View Full Version : icon in address bar



redice
08-23-2005, 12:09 PM
Hi,

Could someone kindly let me know how an icon is inserted in the address
bar, exacly as it is done for this website.
Please also let me know what size the logo has to be and its dpi

redice :confused:

tneulinger
08-23-2005, 12:30 PM
check out this link:
http://tools.dynamicdrive.com/favicon/

i think this will help you :o

regards
tom

redice
08-23-2005, 12:53 PM
cheers,
let me have a look and get back to u

redice
08-23-2005, 01:01 PM
i get an error

Warning: md5_file(/tmp/phpeFNe3V): failed to open stream: Permission denied in /home/ddtools/public_html/favicon/indexalt.php on line 261

Warning: file_get_contents(/tmp/phpeFNe3V): failed to open stream: Permission denied in /home/ddtools/public_html/favicon/indexalt.php on line 269

Failed to read from uploaded file


What could be wrong

jscheuer1
08-23-2005, 01:54 PM
http://www.dynamicdrive.com/forums/showthread.php?p=15632#post15632

tneulinger
08-23-2005, 01:55 PM
maybe you find an other fav icon generator somewhere

jscheuer1
08-23-2005, 02:00 PM
There are plenty on the web, just Google favicon. The DD one should be back up soon. Also, you can make one with any decent icon editor, one which saves files to the .ico format.

redice
08-23-2005, 05:56 PM
cheers all,

so once the icons made....
what next?

Twey
08-23-2005, 07:20 PM
Upload, then use:

<link rel="icon" type="image/x-icon" href="/favicon.ico"/>
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico"/>
in each page to apply it to.

jscheuer1
08-23-2005, 07:38 PM
Upload, then use:

<link rel="icon" type="image/x-icon" href="/favicon.ico"/>
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico"/>
in each page to apply it to.That's pretty ugly looking html code, Twey, though it may work with some browsers. The future is not now. Anyways, no code is needed as long as you upload the favicon.ico to the root of your domain (assuming you have your own domain). If not, each page needs to be assigned the icon but the syntax is much simpler:

<link rel="shortcut icon" href="favicon.ico">This goes in the head of the document. If the favicon.ico is not in the same directory as the page that you are linking it to, use an absolute path to the icon file:

<link rel="shortcut icon" href="http://www.somedomain.com/~mypages/favicon.ico">If you want to see the results of this in IE, be patient as it can take some time (days) to show up. You can usually coax it to show up by tugging at the default icon using a drag and drop motion a few times. Even so, it will probably disappear and reappear with a will of its own in IE. Other browsers will recognize and use it right away or after a single refresh unless something is wrong.

Twey
08-24-2005, 11:23 AM
though it may work with some browsers.
Only IE (as far as I know) looks for /favicon.ico automatically. I think this is because everyone else realized it caused massive amounts of junk in the errorlogs for sites without them.

[Wed Aug 24 00:58:47 2005] [error] [client x.x.x.x] File does not exist: /home/twey/public_html/favicon.ico
[Wed Aug 24 00:58:55 2005] [error] [client x.x.x.x] File does not exist: /home/twey/public_html/favicon.ico
[Wed Aug 24 00:59:12 2005] [error] [client x.x.x.x] File does not exist: /home/twey/public_html/favicon.ico

The type attribute, I believe, is required. Both tags are necessary because some browsers use "icon," some use "shortcut icon" as the rel for a favicon.

(sits back and prepares to be proven wrong)

jscheuer1
08-24-2005, 01:26 PM
OK, I really cannot comment on all browsers. Modern Mozilla looks for favicon.ico. I have a web speed simulator and when I use it to view a page in FF or NS that has no favicon linked to it and that has none available in its root domain, I still get an error 404 file not found, favicon.ico. IE does the same thing except that it is less aggressive about it, requiring that you take some action in the browser that would prompt it to look for favicon.ico - like begin to save a shortcut to the page or bookmark it. Even with a favicon linked to the page IE behaves this way, except that sometimes it just looks anyway, with or without a linked favicon, with or without a call for one. This is why IE's support for favicon is so buggy. I'll fire up KDE and see what Konqueror does but, I recall it is the same as Mozilla in this regard. I also recall that the specification for favicon is to look by default. This cryptic bit from w3.org:

The architecture of the web is that the space of identifiers on an http web site is owned by the owner of the domain name. The owner, "publisher", is free to allocate identifiers and define how they are served.

Any variation from this breaks the web. The problem is that there are some conventions for the identifies on websites, that

/robots.txt is a file controlling robot access
/w3c/p3p is where you put a privacy policy
/favicon is an icon representative of the web site

and who knows what others. There is of course no list available of the assumptions different groups and manufacturers have used.Indicates to me that the mere presence of favicon.ico is all that is required in the specification and that it is implemented as a standard that potentially, can causes problems.

Twey
08-24-2005, 02:39 PM
This isn't cryptic at all.

The owner, "publisher", is free to allocate identifiers and define how they are served.

Any variation from this breaks the web. The problem is that there are some conventions for the identifiers on websites, that

/robots.txt is a file controlling robot access
/w3c/p3p is where you put a privacy policy
/favicon is an icon representative of the web site

and who knows what others.It clearly specifies that they are only conventions, not part of the standard; in fact, that they break the standard, which is that "The owner, "publisher", is free to allocate identifiers and define how they are served."

jscheuer1
08-24-2005, 02:57 PM
Ah, but the implication is that they are followed (sic: the conventions) and empirical testing so far bears this out. I did the Konqueror test and it immediately looks for favicon even when not linked to the page. By implication, that takes in Safari. I'd be willing to make a small wager that Opera does so as well.

Twey
08-24-2005, 03:19 PM
The difference between a standard and a convention (as far as I'm concerned) is that a standard can be relied upon, while no-one will sue the developer if s/he doesn't adhere to a convention. I wouldn't advise relying upon the browser developers to always follow a convention. Despite your results, I would always condone erring on the side of caution and including both links anyway. 70 bytes added to a page is definitely worth increasing compatibility.

mwinter
08-24-2005, 11:39 PM
The type attribute, I believe, is required.No, it isn't. However, I'm sure I read that there was a good reason for including it, but I can't find it. It might have been because some browsers (not IE) can use other image formats, but then the browser still can (and will) use the Content-Type header value sent by the server as that should trump everything (not IE) and the type attribute is only advisory, anyway.



I also recall that the specification for favicon is to look by default.Specification? There's no such thing. It was just something Microsoft introduced for IE5, and made a hash of it. Automatically requesting /favicon.ico is a waste of bandwidth (particularly when the feature was introduced) and inflexible. It's especially wasteful if a site uses custom error handling to provide more useful feedback to users; the error document will be returned for every /favicon.ico request unless the developer pre-empts this (and I hadn't considered that, until recently).

The suggestion of using a link element is better, but that was ill-conceived, too as the rel attribute is a space-separated list of link types, so 'shortcut icon' should be considered two separate types. Mozilla does the sensible thing and considers 'icon' as the relevant link type, though I don't know if 'shortcut icon' was also made a special case (so that 'shortcut' would be ignored).


I'd be willing to make a small wager that Opera does so as well.Opera, since 7.1, can be configured to ignore /favicon.ico and only use 'embedded' icons.

Mike

jscheuer1
08-25-2005, 06:33 AM
Sounds to me then, when all the dust has settled, my method works in the default state of all browsers mentioned so far. This favicon thing should, and hopefully will be reformulated. Until then folks, just upload the darn thing to the root of your domain.

Twey
08-25-2005, 09:47 AM
Hopefully it'll be reformulated not to auto-request /favicon.ico. "Until then," upload it to the root of your domain and link to it - for forward compatibility. ;) In light of the above, however, perhaps you shouldn't use the "shortcut icon" link.

jscheuer1
08-25-2005, 03:25 PM
Hopefully it'll be reformulated not to auto-request /favicon.ico. "Until then," upload it to the root of your domain and link to it - for forward compatibility. ;) In light of the above, however, perhaps you shouldn't use the "shortcut icon" link.Ah, but the future is not now. I've seen many more examples of new browsers being backward compatible than examples of new browsers implementing a standard or convention in exactly the way anticipated by us code freaks.

Twey
08-25-2005, 04:08 PM
But to put it in the root and link to it is both forward and backward compatible, and so intrinsically a good idea.

jscheuer1
08-25-2005, 04:22 PM
Not necessarily forward, to wit your mention of the already problematical:

"shortcut icon"

Twey
08-25-2005, 04:27 PM
I did remark that perhaps that shouldn't be used, in light of Mike's information. That, by the way, was an example of backward-compatibility.

redice
08-26-2005, 03:05 PM
Thanks all
Really appreciate the help

Twey
08-26-2005, 03:14 PM
No problem.

elan_vital
01-25-2006, 09:45 PM
How can I use the <link rel=shortcut icon> if I'm already using a CSS style sheet in the <link re=stylesheet>??? Is there a way to get around this?

Thanks,

Brandon

jscheuer1
01-26-2006, 04:51 AM
How can I use the <link rel=shortcut icon> if I'm already using a CSS style sheet in the <link re=stylesheet>??? Is there a way to get around this?

Thanks,

Brandon

That is immaterial. You can have as many 'rel's as you need on a page, they are simply attributes of the tags that they appear in, one does not overwrite another. However, you really do not need <link rel=shortcut icon> if you have a domain and your favicon is named favicon.ico and it is in the root of your domain. For all other cases, the <link rel=shortcut icon> is required and needs to be on all of your pages and needs to have its href attribute set to the actual location of the favicon icon.

Twey
01-26-2006, 05:11 PM
It's rel="shortcut icon". Don't forget the quotes - it's not valid and it's even worse when there's a space involved.