Losing my styles in external CHMs...

This forum is for all Flare issues related to the Microsoft HTML Help target.
This target produces "CHM" files in the output.
Post Reply
rkiskan
Propeller Head
Posts: 30
Joined: Fri Feb 03, 2006 4:56 am
Location: Denmark

Losing my styles in external CHMs...

Post by rkiskan »

Hi,

I am experiencing problems with styles when linking to topics in external CHMs. For example, I have a MasterProject. In the TOC of the MasterProject I have included the ChildProject CHM. A topic in MasterProject, call it MasterTopic, links to a topic in ChildProject - call it ChildTopic.

When the projects have been generated the link from MasterTopic to ChildTopic works fine. I can set it as a pop-up, parent frame, etc. No problem, but the fonts are all gone. ChildTopic always displays in Timea New Roman unless it is a pop-up (it should be Arial). A few days ago it was the opposite, the pop-up displayed wrong fonts. Any suggestions?

thanks
Robin
KevinDAmery
Propellus Maximus
Posts: 1985
Joined: Tue Jan 23, 2007 8:18 am
Location: Darn, I knew I was around here somewhere...

Re: Losing my styles in external CHMs...

Post by KevinDAmery »

In Flare 3.x they introduced a feature that improved the ability to print from a CHM - unfortunately, the drawback is that it made CHMs not use their stylesheets correctly anymore. It sounds like one or more of your projects may have this feature turned on.

You can find it in the Target file under the Advanced tab, and it is called "Patch stylesheet and image links for HTML Help printing." If this is on, try turning it off and rebuild your CHM - the appearance should be correct.
Until next time....
Image
Kevin Amery
Certified MAD for Flare
rkiskan
Propeller Head
Posts: 30
Joined: Fri Feb 03, 2006 4:56 am
Location: Denmark

Re: Losing my styles in external CHMs...

Post by rkiskan »

Hi Kevin,

The settings was not selected in the targets, but to be sure I selected them and deselected ... but it made no difference. The styles are still not being correctly applied when linking topics accross CHMs.

Robin
rkiskan
Propeller Head
Posts: 30
Joined: Fri Feb 03, 2006 4:56 am
Location: Denmark

Re: Losing my styles in external CHMs...

Post by rkiskan »

I should also add, it is clearly not finding the CSS in the child project, or for that matter any CSS in the master Flare project (which has a CSS with the same name as the child CSS).

If I change the default font selection on Internet Explorer, then the unformatted CHM topic renders in that font. Unfortunately we cannot force our customers to select a different type of font in their IE. I have also tried it with IE8 and the problem persists.

Robin
Pete Lees
Sr. Propeller Head
Posts: 150
Joined: Thu Feb 09, 2006 12:33 pm
Location: Bracknell, Berkshire, UK

Re: Losing my styles in external CHMs...

Post by Pete Lees »

Hi, Robin,

If you view the HTML source of a topic in the child file — right-click the topic pane of the help window and then click View Source on the context menu — how is the style sheet linked to the topic? You should have an element like this at the start of the topic:

Code: Select all

<link rel="stylesheet" href="YourStyleSheet.css" type="text/css" />
Or possibly like this:

Code: Select all

<link rel="stylesheet" href="ms-its:YourChildFile.chm::/YourStyleSheet.css" type="text/css" />
Determining how the style sheet is linked to the topic should provide some clues as to the cause of the problem.

Pete
rkiskan
Propeller Head
Posts: 30
Joined: Fri Feb 03, 2006 4:56 am
Location: Denmark

Re: Losing my styles in external CHMs...

Post by rkiskan »

Hi Pete -

Yes, we tried that. I also gave each CHM its own CSS and when looking at the source from the merge it was showing that unique CSS. I even tried to fool the system by using a single common CSS name accross all topics - no difference. What is is fdoing is defaulting to the Browser's default font.

But there are more and more problems, and I honestly believe that it does not work. For example, you cannot use drop-down without getting some JS errors because it cannot find the JS libraries. Also images do not render - It's as if the focus of the resources is lost when you use topics in external CHMs. Strangely enough sometimes it's pop-ups that fail, other times its straight links to display in the parent window that fails.

I have spent at least 30 hours in the past 3 days trying to get this to work - hours on the phone to MadCap and they are stumped.

Robin
Pete Lees
Sr. Propeller Head
Posts: 150
Joined: Thu Feb 09, 2006 12:33 pm
Location: Bracknell, Berkshire, UK

Re: Losing my styles in external CHMs...

Post by Pete Lees »

Hi, Robin,

What do your Link elements look like? If you're using the ms-its: type links, is there a forward slash preceding the name of the style sheet? I believe that this link should normally be fine:

<link rel="stylesheet" href="ms-its:YourChildFile.chm::/YourStyleSheet.css" type="text/css" />

but this may be problematic:

<link rel="stylesheet" href="ms-its:YourChildFile.chm::YourStyleSheet.css" type="text/css" />

Does registering the location of each .chm file under the following key in the Windows registry make any difference?

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\HTML Help

If it does, you might ask your developers to register the .chm files as part of their software installation process.

Pete
rkiskan
Propeller Head
Posts: 30
Joined: Fri Feb 03, 2006 4:56 am
Location: Denmark

Re: Losing my styles in external CHMs...

Post by rkiskan »

Hi Pete -

In all my links I don't have any reference to the CSS. What I did found is if on the Advanced settings of the HTML Help Target:
- Patch stylesheet and image links for HTML Help printing - is selected
- Stylesheet Medium is set to "non-print"
then the topic that is being linked to does indeed render OK.

However, is cannot find images (get the red x icon) and it cannot use any JavaScript such as in drop-downs (reports Object not found). It's as if the topic is out of context to where it should be sourcing the functionality.


Robin
KevinDAmery
Propellus Maximus
Posts: 1985
Joined: Tue Jan 23, 2007 8:18 am
Location: Darn, I knew I was around here somewhere...

Re: Losing my styles in external CHMs...

Post by KevinDAmery »

rkiskan wrote: - Patch stylesheet and image links for HTML Help printing - is selected
Robin,

This is what I mentioned earlier. You have to turn that option off for the CHM to use it's CSS correctly.
Until next time....
Image
Kevin Amery
Certified MAD for Flare
rkiskan
Propeller Head
Posts: 30
Joined: Fri Feb 03, 2006 4:56 am
Location: Denmark

Re: Losing my styles in external CHMs...

Post by rkiskan »

Yes Kevin, I tried that, but when not selected the fonts were lost. I had to select it to get it render properly - it is working the reverse of what is expected. But that still doesn't solve the missing JS issues.

Robin
Post Reply