Pages: 1
Print
Author Topic: Favicons in WebHelp  (Read 7090 times)
kwag_myers
Member

Posts: 69


« on: December 02, 2011, 09:08:17 AM »

In Firefox 8, a missing favicon is substituted with a blank box, which doesn't make for a good impression. So, I'm attempting to add favicons to my web help with marginal success. I'm using the following syntax in the header of the index.html:

<link rel="shortcut icon" type="image/x-icon" href="xmwebhelp/images/favicon.ico" />

The favicon displays on the Bookmark menu/tool bar, but not the tab or address bar. So, obviously, I'm missing a step in the process. Please advise.
Logged

XMetaL 6 Author in Windows 7 Home Premium
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #1 on: December 02, 2011, 12:32:31 PM »

Googling "firefox 8 favicon" gives me this page:

"favicons broken in Firefox 8"
http://forums.mozillazine.org/viewtopic.php?f=38&t=2357579
Logged
kwag_myers
Member

Posts: 69


« Reply #2 on: December 05, 2011, 09:18:43 AM »

Thanks Derek, but this thread seems to deal with missing favicons. I want to know how to add the favicon supplied by my client so that it displays in the tab and address bar like it does in the client's product. Sorry if my first post was misleading.
Logged

XMetaL 6 Author in Windows 7 Home Premium
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #3 on: December 05, 2011, 12:10:09 PM »

If you are asking how to change the HTML the DITA OT creates so that it adds your <link> into the <head> section of your HTML files you can add anything in there using the "HDF" setting and pointing it to a file containing the HTML to add. We expose that option in the Configure Output dialog. See attached image.


* HDF_setting.jpg (110.99 KB, 977x570 - viewed 601 times.)
« Last Edit: December 05, 2011, 04:54:42 PM by Derek Read » Logged
kwag_myers
Member

Posts: 69


« Reply #4 on: December 07, 2011, 08:13:13 AM »

Not working. Yesterday I had two JS programmers working on it and they are stumped too. And this is not just a Firefox issue, I can't get the favicon to display in IE or Chrome either.

What's really frustrating is that the favicon displays in the address bar as the page is loading, but then reverts to the blank box. The only way I can get this to work is to force a download of the image with a script. The problem there is the image displays in the body, not the web help.
Logged

XMetaL 6 Author in Windows 7 Home Premium
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #5 on: December 07, 2011, 12:00:33 PM »

So this isn't a DITA OT issue (or WebHelp generation issue) then, as it is fully capable of putting anything you like into the <head> section of the HTML (using the setting previously noted).

Things to check (gathered from what Google thinks are the top 10 of apparently hundreds of thousands of pages on this topic):

Some browsers only support favicon in one format, though some support others (PNG, GIF, ICO).
Some browsers only support certain flavours of these image types (the ICO format in particular seems to be easily messed up by some image creation software).
A browser running on different operating systems (Windows vs Mac in particular) may behave differently.
Some browsers only support the favicon when it is served from a web server, not from your local machine.
Some browsers only support the favicon when it is located in the root folder of your web server, they do not support specific paths to these files.
Different versions of the same browser have varying support for this feature (as with all other browser features).

The whole business of the favicon was invented for IE with no official spec and then adopted ad-hoc by other browser makers so there's no official rules for this. This is possibly the only thing that comes close: http://www.w3.org/2005/10/howto-favicon
It might help a little bit but obviously not for any browser that hasn't read and implemented support along those lines.

This might help too if you haven't seen it: http://en.wikipedia.org/wiki/Favicon (there are 36 links to references at the bottom of that page as well)
« Last Edit: December 07, 2011, 12:02:09 PM by Derek Read » Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #6 on: December 07, 2011, 12:13:45 PM »

It sounds like this was included by the W3C in the HTML 4.01 recommendation, though I haven't yet been able to locate the part of the recommendation that discusses it. Probably still doesn't really help if browsers implement support for it differently, unless you just want to stick to the standard and ignore browsers that don't.
Logged
kwag_myers
Member

Posts: 69


« Reply #7 on: December 08, 2011, 08:12:21 AM »

Some browsers only support the favicon when it is served from a web server, not from your local machine.
This seems to be the issue I'm having. I uploaded to a test server and both IE and Chrome display the favicon in the tab. Chrome doesn't seem to support the favicon in the address bar, but IE does and it's working there, too.

As for Firefox, I've read that favicons often show up after the user loads the page several times. There's not much more I can do for FF users. Judging from all the "Missing favicon" threads, I'll be watching for FF9's release to see what changes Mozilla makes in support of favicons.

Thanks for all the research!
Logged

XMetaL 6 Author in Windows 7 Home Premium
kenfesta
Member

Posts: 8


« Reply #8 on: July 16, 2012, 02:24:57 PM »

Hi Derek,

I wanted to try the approach you suggested, but I'm a little confused about MyOwnHTMLHeadStuff.txt

What does that file look like?

I can just put in any html that is relevant to a header section?

thanks
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #9 on: July 16, 2012, 02:47:58 PM »

The DITA OT documents this. The parameters when dealing with the DITA OT directly are: ftr, hdf, and hdr (corresponding to the settings that we provide in our dialog with similar names).

See:
http://dita-ot.sourceforge.net/1.5.4/readme/dita-ot_ant_properties.html

Unfortunately I think that documentation is a bit misleading as it states "well-formed XML file". While that is technically true, it isn't very specific. What this file should really usually contain is XHTML that will be valid where it is inserted.

FTR is inserted at the end of the <body> element in the XHTML, before the closing </body> tag.
HDF is inserted at the end of the <head> element in the XHTML, before the closing </head> tag.
HDR is inserted at the start of the <body> element in the XHTML, after the opening <body> tag.

Code: (FTR Example)
 <div class="legal">
    <img src="images/logo.jpg"/>
    <a href="copyright.html">Copyright XYZ Corporation</a>
  </div>


« Last Edit: July 16, 2012, 02:52:35 PM by Derek Read » Logged
Pages: 1
Print
Jump to: