Skip to main content
April 19, 2010
Question

Making the contents of the <title> tag conditional

  • April 19, 2010
  • 2 replies
  • 535 views

(RH HTML, version 8.0.2.208.)

Hi all,


Is there a way of making the contents of the <title> tag conditional? One of my topics needs to have a different title according to the chm it goes into (designer chm or end user chm). Search results are based on the contents of the <title> tag, not of <h1>, so the contents of the <title> tags do need to be specific.

I tried applying conditional tags inside the code manually (I copied <?rh-cbt_start condition="Designer" ?>, etc), but it just doesn't work (both versions of the title show).

Then I created 2 different html files, each with the correct <title>, and inserted the contents of the topic as a snippet. That worked OK. But now I have an image map in another topic that refers to my double-file topic (and this image map appears in both versions of the chm as well)! The only way to make things work is to have 2 versions of the image map, each with the correct link.

I thought the idea of single sourcing was to make things simpler and to save time... Did I miss something? Does anyone have any suggestions?

Thanks, C.

    This topic has been closed for replies.

    2 replies

    April 20, 2010

    Thanks to you both for your responses. I have submitted a feature request.

    Rick, were you suggesting to insert the Related topics button on top of the image map?

    C.

    April 20, 2010

    Mmm... as far as the image map is concerned, it seems that the conditional expression I tried using yesterday to no avail is now working (I made the <area/> tag conditional). I changed nothing in the meantime, all I did was close and reopen the project. No accounting for RoboHelp behaviour...

    (Of course, this changes nothing to the conditional <title> tag issue.)

    Captiv8r
    Legend
    April 19, 2010

    Hi there

    Looks like you have done your homework!

    Indeed it would be a nice feature to be able to conditionalize the Title attribute. Please take a moment and suggest it via the Wish Form.

    What I might suggest is that you create a Related Topics link that points to each of the desired topics. My hope here is that when one or the other topics is removed by conditionalizing, it will leave behind a single link. Then instead of seeing a popup chooser, the link just works to open the single topic.

    Give that a go and see how well it may work.

    Cheers... Rick

    Helpful and Handy Links

    RoboHelp Wish Form/Bug Reporting Form

    Begin learning RoboHelp HTML 7 or 8 within the day - $24.95!

    Adobe Certified RoboHelp HTML Training

    SorcerStone Blog

    RoboHelp eBooks

    Peter Grainge
    Community Expert
    Community Expert
    April 19, 2010

    This is an outstanding feature request so do submit your request to up the chances. It's needed for people who work with multiple languages too.


    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.