In RH8 it isn't possible (have a look at this thread : http://forums.adobe.com/message/2749534#2749534). A workaround is to do 2 html files, and insert the contents of the topics as a snippet. You can also have a "proper" topic in one file and a second "placeholder" file with a frame in it that contains the first topic.
Btw, does anyone know whether it is possible to make the title tag conditional in RH9 ?
What's the issue with just repeating the title text on 2 lines and conditioning each one of them? When you generate you would just tell the SSL to omit one of them, wouldn't you?
At first, it looked like your solution (two <title> elements, conditionalized) would work.
This is what I set in the HTML:
<?rh-cbt_start condition="App1_Only" ?><title>Reports To, Sites/Entities</title><?rh-cbt_end ?>
<?rh-cbt_start condition="App2_Only" ?><title>Reports To, Sites</title><?rh-cbt_end ?>
It looks like this is working when I use the preview.
But during the generation, RH actually stripped out the conditionalizations and replaces them with this in the ***source*** file:
<title style="x-condition: App2_Only;">Reports To, Sites/Entities</title>
...which is not at all what I wanted. The output had 2 title lines:
I also tried this:
<title>Reports To, <?rh-cbt_start condition="App1_Only" ?>Sites/Entities<?rh-cbt_end ?><?rh-cbt_start condition="App2_Only" ?>Sites<?rh-cbt_end ?></title>
That one was changed to this in the output:
<title>Reports To, Sites/EntitiesSites</title>
So I think this is just not going to work. Phooey.
Seems to work fine for me in RH9.01 - I created 2 Heading1 lines and applied "Print" to one of them and "Online" to the other. No matter which way I generated, I got the one that I wanted to appear.
There might be some confusion here. I believe Jenny is wanting to conditionalize the <Title> tag, not the <H1> or heading. It's the Title that comes up in the Search results. These two entities are often mistaken, one for the other. This is because while they are often coincidentally the same words, this is not always the case.
Oh - and that comes from the title you give the topic when you first create it, right? I didn't think it was even possible to condition a title without applying the condition to the entire topic.
One way this could be achieved would be to create two separate topics. Each one bearing the desired Title. Now before you go off hollering that I can't read because you said you don't wish to take this approach, bear with me.
You would then configure each topic so that all it contains is an Inline frame sized to 100% width and height. Then point the Inline frame to the desired topic content.
By taking this approach you will be able to achieve what you want. Sure, there will be two additional topics, but the only reason for their existence will be to present the desired Topic Title. You should have no need to make further edits.
Helpful and Handy Links
I am using the latest version of TCS. I did run Tools > Update DHTML Effects.
Saving the topic still strips out the first conditional <title> tag and changes the 2nd one to
<title style="x-condition: App2_Only;">Reports To, Sites</title>
If I use conditional text within the title tag, it gets stripped out, leaving all of the actual text.
I am trying to set up this help system so that the people who come after me can easily maintain it. If I start using tricky stuff like you suggest, I think it will be harder for them to set up additional field topics later.
So I think I'm still stuck.
I do appreciate all the suggestions!
What about snippets? I might be wrong, but it seems to me that snippets would be less unsettling to people who are not used to RH than the frames solution. Using snippets in RoboHelp is quite easy. When you open a topic that contains a snippet in the RH editor, the text of the snippet does show (it isn't the case with frames).
If the people who are going to maintain your help system can understand how to work with conditional tags, and understand the importance of what you put in the <title> tag, then it does not seem unreasonable to think that they would understand how to work with snippets, provided with a few explanations.
Maybe I am misunderstanding what you are suggesting, but we have quite a lot of field topics that would have to become snippets in this case - maybe 300 of them. Wouldn't that be hard to manage?
Ah, with 300 topics it wouldn't...
The easiest solution would be to drop the system altogether. Is your issue that you have many fields with the same names, doing different things, on different screens, and you want your users to find the correct one easily in the search results? If your output is WebHelp, you may be able to customize the message that appears above the search box (I'm not too sure on that one), recommending users to type not only the name of the field but also the name of the screen it appears on (of course you'd need to have the name of the screen somewhere in the body of the topic). You could also include these recommendations in a "How to search the help" topic.
If I were you I'd go to my boss and explain the options (frames, snippets, drop the system) and their respective costs (set up, maintenance, including training the people that will take over from you), and let them decide what they want to do.
I had logged a feature request so that the contents of the <title> tags could be made conditional, but from what you say it seems they haven't included the feature in RH9. That is a very interesting issue, if anyone else has ideas I would really appreciate them.
I would like to see the enhancement request go beyond just title tags, to allow conditionalizing of any
HTML code. We also have topic-specific and application-specific See Also lists that were created using custom HTML code. I was hoping to conditionalize them so that only the appropriate ones display. That isn't working, either.
Part of the problem is that we are importing our help into RH from a non-standard toolset (FAR HTML and HTML-Kit snippets). So we have done some non-standard coding that is difficult to replicate in RH.