Skip to main content
May 9, 2011
Question

Setting HTML title text as conditional

  • May 9, 2011
  • 13 replies
  • 1593 views

Hi,

I've been having great fun with the conditional text feature.  But I need to be able to conditionalize some of the text in the HTML <title> tag, and I don't see a way to do it.  The title text shows up when you perform a search, so it is important to use the correct text in each case.

For example, I have a "Reports To" field topic that appears on the "Sites/Entities" form in one version of the application but in the "Sites" form in another version of the application.  Our style is to include the field name and the form name in the <title> tag, like this:  "Reports To, Sites/Entities"  or "Reports To, Sites".  So I need to be able to conditionalize it.

Any suggestions?  I do not want to create 2 separate topics that are exactly the same except for the title tag.

thanks,

Jenny

    This topic is closed to new replies. Start a new post to keep the conversation going.

    13 replies

    Jeff_Coatsworth
    Community Expert
    Community Expert
    May 9, 2011

    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?

    May 9, 2011

    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:

    <title>Site, Sites/Entities</title>
    <title>Site, Sites/Entities</title>

    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.

    Peter Grainge
    Community Expert
    Community Expert
    May 9, 2011

    The amended code looks like the code from an old version of RoboHelp. What version are you using?

    Try going to Tools > Update DHTML Effects and see if that changes it.


    See www.grainge.org for RoboHelp and Authoring tips

    @petergrainge

    Use the menu (bottom right) to mark the Best Answer or Highlight particularly useful replies. Found the answer elsewhere? Share it here.
    May 9, 2011

    Hi Jenny,

    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 ?

    C.