Copy link to clipboard
Copied
Hi,
Was wondering if it is possible to use multiple icons for topic pages in RH7 (Webhelp output) Table of Contents.
I know how to change the icon for books and topics/pages, but that change is uniform to all topics and pages. Is there a way to assign a different icon to multiple pages and another to other pages, etc.
Thanks in advance.
Mike P
Copy link to clipboard
Copied
Hi there
There is a way but it's so painful as to make it very unworthwhile.
This is something many have desired and expressed interest in. Please consider asking Adobe for it. You do this using the Wish Form.
Cheers... Rick
Helpful and Handy Links |
Copy link to clipboard
Copied
Hi Rick,
Thank you for the very quick comeback on this. I will indeed mention it in the wish section.
Just for curiosityies sake, you wouldn't have a link or description of the "very painful" process would you?
Again, thanks for getting back.
Mike P
Copy link to clipboard
Copied
Hi Mike
I'd have to do some deep digging on an old computer in order to unearth the information. If memory serves, the process was to locate a specific JavaScript file. Then locate a specific function. You duplicated the function and gave it a different name. Then you modified it to use the image of your choosing. Then you had to somehow reference the correct TOC element to point specifically to that function.
I recall trying what was outlined with no success, so obviously I had overlooked a step or it wasn't properly conveyed to me to begin with. Ultimately I simply abandoned adding it to my Skinny on Skins file as I figured if I was unable to make it work I felt others probably would be as well.
The steps were provided to me by another forum member a few years ago. Who knows, maybe they are reading this post right now. So perhaps they will offer to send you the steps.
Cheers... Rick
Helpful and Handy Links |
Copy link to clipboard
Copied
Hi Rick,
Thanks much for getting back to me.
You are right - definately too painful to attempt. š
Much appreciate you taking the time.
Mike
Copy link to clipboard
Copied
Actually, Rick, you do have it in your Skinny on Skins tutorial, in the Inserting additional images following specific links in the TOC topic under Navigation Pane > Table of Contents (TOC). It requires inserting code into the output whthost.js file and using that edited file (saved and stored elsewhere) to overwrite the one generated by RH every time you generate the project.
I use it for several pages, but the trick to making this work (as it is for any Javascript code) is to ensure that no line breaks get introduced in the transfer of code from your sample into the whthost.js file. When you save the file, human-readable line breaks and indents will be added, but those will not affect the performance of the function; they are only an issue if they are in the code when you initially paste it in). This works for me:
The bold text below is an example of one page (I actually have five of them), as it appears in my project (the code before and after it are the default lines generated each time by RH). Note that the title for the "if" Name must match the TOC entry exactly, and is case-specific. Note also my use of \n to generate a new line in the tooltip (to compress it into a more readable block instead of a long, single line).
Sigh...if only someone could come up with the code to do this for books, too. Now that would be cool!
if(sTarget!="")
sHTML+="target=\""+sTarget+"\" ";
if (getItemName(nIdx) == "Release Notes")
sHTML+="href=\""+_textToHtml_nonbsp(getItemURL(nIdx))+"\" title=\"Version 9 new features,\nenhancements, and known \nissues, in PDF format\"><img alt=\""+sAltString+"\" src='pdf_page.gif' border=0 align=\"absmiddle\"> "+sName+"</a></nobr></p>";
else
sHTML+="href=\""+_textToHtml_nonbsp(getItemURL(nIdx))+"\" title=\""+sName+"\"><img alt=\""+sAltString+"\" src=\""+sIcon+"\" border=0 align=\"absmiddle\"> "+sName+"</a></nobr></p>";
return sHTML;
}
Good luck,
Leon