2 Replies Latest reply on Sep 27, 2011 1:29 PM by rlauriston

    adding a script to every topic in an existing WebHelp project

    rlauriston Level 1

      I've got WebHelp (RH8, but could upgrade if necessary) running on Apache.

       

      What are my options for adding a script (probably PHP) to every topic?

       

      In the past, with other HATs, I've put stuff like that in master pages and in skins.

       

      From a comment in http://forums.adobe.com/message/3939811 I get the impression that nothing I do to a master page will affect existing topics?

       

      How about skins?

       

      Any other options besides running a script to make global changes to the source files or output files?

       

      Obviously if I define the script globally I'd need to use variables or replaceable parameters or the like in the script to customize it for each page. Is Robo helpful for that or should I be looking to the Apache environment for those values?

        • 1. Re: adding a script to every topic in an existing WebHelp project
          Captiv8r Adobe Community Professional & MVP

          Hi there

           

          Okay... Master Pages... Topic Templates... They are essentially the same thing. RoboHelp 8 began calling them Master Pages.

           

          For starters, do we want to use Master Pages to create new topics with? Or do we want to define something inside the Master Page and apply it to existing topics?

           

          My assumption is that you already have topics and simply wish to associate a Master Page with them.

           

          When you define a Master Page in RoboHelp 8 or 9, it will contain a Body placeholder. Whatever is inside the Body placeholder will end up being copied into any new topics you create that use the Master Page. But that's where it ends with stuff in the Body placeholder. After you create the topic, changes to the Body placeholder inside the Master Page *ARE NOT POPULATED* into the topics created from the Master Page. So you may change the Master Page substantially and the topics associated with it will remain unaffected.

           

          Note that you may also use a Master Page to populate Headers and Footers across existing topics. You have to do this by editing the Master Page and clicking View > Header or View > Footer in order to bring them into view. And once you do this, you may populate them with information. And using Master Pages in this fashion *DOES* allow subsequent changes to the Master Page to be populated across all topics associated with the Master Page.

           

          The problem here is this. You are wanting to use the latter feature to populate additional content across topics. So far so good. But you also have a need to make that content customized to each topic, no? And if that's the case, you won't be able to use Master Pages to maintain that content. I suppose you might put it in a Master Page initially just to get the code copied to all topics. But when you make changes to it to individualize it on a per topic basis, RoboHelp will pop up a warning advising the topic content is different and it will ask you what you want to do. Update the Master Page so ALL topics associated see the changed code? Or disconnect from the Master Page and leave your changes as you wish inside the topic.

           

          Another issue with this is that based on your other post, you need some PHP code above the topic content in a place that occurs before the HTML page is even defined. And that one may prove tricksy to implement. I suppose you might use what I suggested earlier to get the code in the topic, but you will still need to carefully hand edit each topic and move the code to where it should go.

           

          Hopefully this was helpful... 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

          1 person found this helpful
          • 2. Re: adding a script to every topic in an existing WebHelp project
            rlauriston Level 1

            Thanks, that answers my question about footers in Master Pages, I could use them and they do work pretty much as in other tools.

             

            Can you add a script (for a button) with a skin, and if so are there advantages or disadvantages?

             

            "... you also have a need to make that content customized to each topic, no"?

             

            Not in the sense that the script code would be different for each page. See the last paragraph of my original post.