Skip to main content
Participating Frequently
July 26, 2011
Answered

Add code to all Topics in one go

  • July 26, 2011
  • 1 reply
  • 588 views

Hello,

I've been trying to figure this out but I just don't understand why this is happening. I'm using sed (in cygwin) to append a javascript and iframe to topics but following the sed all topics become forbidden.  It must be with how I did sed so I just wanted to find out:

if there is a way to modify the masterpage with some constant content and it will roll out to all child topics. I am trying to add an iframe and javascript to all topics. The code will be exactly the same for all topics (i've created a dynamic page that will display content base on the parent page). Would I use placeholder? Adobe scripting?

    This topic has been closed for replies.
    Correct answer Willam van Weelden

    Hi,

    You can use masterpages. Add the code you want in the header or footer of the masterpage. All topics associated with the masterpage will get that code. That means that the iframe is positioned above or below the topic content.

    If you want it somewhere else, you probably want to add the code after you generated the output. You can use any Find/Replace tool for that, or create a script in RoboHelp to do that for you.

    Greet,

    Willam

    1 reply

    Willam van Weelden
    Willam van WeeldenCorrect answer
    Inspiring
    July 27, 2011

    Hi,

    You can use masterpages. Add the code you want in the header or footer of the masterpage. All topics associated with the masterpage will get that code. That means that the iframe is positioned above or below the topic content.

    If you want it somewhere else, you probably want to add the code after you generated the output. You can use any Find/Replace tool for that, or create a script in RoboHelp to do that for you.

    Greet,

    Willam

    ddng911Author
    Participating Frequently
    July 27, 2011

    The header works fine, but I would prefer it if I can put in the body. The Find replace tool doesn't allow for multiple line replacement. I'm new to Adobe scripting so I jsut wnted to find out how you can access all topics and search through them for a pattern.

    Willam van Weelden
    Inspiring
    July 28, 2011

    Hi,

    The Find replace tool doesn't allow for multiple line replacement.

    You can use a third-party tool for that. FAR is quite popular. See http://helpware.net/FAR/

    See http://www.adobe.com/devnet/robohelp/articles/robohelp-extendscript.html for an introduction to scripting with RoboHelp.

    The following script may be a good example script: http://www.wvanweelden.eu/robohelp/scripts/ierendertags


    Be sure to check out the standard script provided by Adobe. Please post back if you have any questions.

    Greet,

    Willam