Conditional root title?

This forum is for all Flare issues related to the Microsoft HTML Help target.
This target produces "CHM" files in the output.
Post Reply
hoss
Propeller Head
Posts: 37
Joined: Thu Nov 04, 2010 3:21 am

Conditional root title?

Post by hoss »

I have a project that builds several HTML help outputs.
At the moment the root topic is called 'Welcome', which appears in the index and breadcrumbs line etc
What i would really like is that this title is the title is conditional on the output target.
I don't see any neat way of doing this.
(Other than creating multiple topics in the TOC and giving each a condition... or multiple TOCs - neither of which are ideal as there are currently 9 outputs with more to follow) )
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Conditional root title?

Post by LTinker68 »

You can do this. Create a variable called welcomeText and give it placeholder text like Title Here. In your welcome topic, replace "Welcome" with the variable and do the same in the TOC (dragging the topic to the TOC is the easiest way of doing that). Then in each target, go to the variables tab and replace the placeholder text (Title Here) with the appropriate text for that output. When you generate each output, it will use the variable value that was overridden in that target instead of the default value in the project's variable set. If you ever generate an output and see Title Here in the output, then you know you forgot to override the variable in that output's target file.

Just make sure you don't populate the title field in the topic's Properties screen -- that field will override the first heading's value in the search and index. If that field is blank, then the search and index will use the first heading found in the topic.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
hoss
Propeller Head
Posts: 37
Joined: Thu Nov 04, 2010 3:21 am

Re: Conditional root title?

Post by hoss »

ahh thats interesting, I never knew that the target variables overrode if used, i thought they were another way to edit the common variables.
In fact in other places where i've needed to make conditional text, i've made snippets containing conditionally flagged variables.

Anyhoo...
The bit i dont get is " replace "Welcome" with the variable and" - what do you mean specifically?
Do you mean the H1 heading? If so thats a problem as the first h1 is not the title i want (although i could do it that way if thats the only way)
hoss
Propeller Head
Posts: 37
Joined: Thu Nov 04, 2010 3:21 am

Re: Conditional root title?

Post by hoss »

Ok, yes worked it out for myself. Put [%=VariableSet.VariableName%] into the TOC title and topic property title

That seems to work, thank you very much Lisa ;)
Post Reply