13 Replies Latest reply on May 10, 2011 9:13 AM by hecjen

    Setting HTML title text as conditional

    hecjen

      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

        • 1. Re: Setting HTML title text as conditional
          TW_75

          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.

          • 2. Re: Setting HTML title text as conditional
            Jeff_Coatsworth Adobe Community Professional & MVP

            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?

            • 3. Re: Setting HTML title text as conditional
              hecjen Level 1

              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.

              • 4. Re: Setting HTML title text as conditional
                Peter Grainge Adobe Community Professional (Moderator)

                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

                • 5. Re: Setting HTML title text as conditional
                  Jeff_Coatsworth Adobe Community Professional & MVP

                  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.

                  • 6. Re: Setting HTML title text as conditional
                    johndaigle Level 4

                    Hey, Jeff!
                    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.

                    john

                    • 7. Re: Setting HTML title text as conditional
                      Jeff_Coatsworth Adobe Community Professional & MVP

                      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.

                      • 8. Re: Setting HTML title text as conditional
                        Dilbert1975

                        Hi Folks

                         

                        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.

                         

                        Cheers... Rick

                         

                         

                        Helpful and Handy Links

                        RoboHelp Wish Form/Bug Reporting Form

                        Begin learning RoboHelp HTML 7, 8 or 9 within the day!

                        Adobe Certified RoboHelp HTML Training

                        SorcerStone Blog

                        RoboHelp eBooks

                        • 9. Re: Setting HTML title text as conditional
                          hecjen Level 1

                          Peter,

                          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.

                           

                          Rick,

                          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!

                           

                          Jenny

                          • 10. Re: Setting HTML title text as conditional
                            TW_75 Level 1

                            Jenny,

                            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.

                            C.

                            • 11. Re: Setting HTML title text as conditional
                              hecjen Level 1

                              Hi C,

                              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?

                               

                              thanks,

                              Jenny

                              • 12. Re: Setting HTML title text as conditional
                                TW_75 Level 1

                                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.

                                C.

                                • 13. Re: Setting HTML title text as conditional
                                  hecjen Level 1

                                  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.

                                   

                                  Jenny