Skip navigation
Currently Being Moderated

WebHelp - Executing a search using URL parameters

Mar 20, 2013 3:21 PM

Hello everyone,

 

I'm trying to figure out how to execute a search in a WebHelp output by calling it from the URL, just like I do with map IDs. Basically, I'd like to do something like this:

 

http://www.myserver.com/help/robohelp/index.htm?search=mysearchterm

 

Or any variant. I've tried searching the help files and the internet but can't find out how to do this.

 

Any idea?

 
Replies
  • Currently Being Moderated
    Mar 20, 2013 3:33 PM   in reply to OL-Lachance

    While I'm sure there is probably a way to make it happen, I can't recall ever seeing anyone post a way to do it.

     

    If anyone knows, it would be Willam.

     

    Tap tap tap... Hellooooo, Willam. Willam, are you there?

     

    Cheers... Rick

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 21, 2013 2:49 AM   in reply to Captiv8r

    Who's there?

     

    This requires some output file hacking. I have never attempted this before, but I'm sure it can be done given enough effort

     

    Basically, it involves the following:

    - Amend the CSH sniffer to include your search capabilities.

    - Modify the CSH call to call the search pane and automatically start a search.

     

    I think this is quite a project to get this done in WebHelp. I'll look into it in more detail. Please bear with me.

     

    Greet,

     

    Willam

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 21, 2013 4:07 AM   in reply to OL-Lachance

    I'm curious to know why you would want a search that is outside Rh?

     


    See www.grainge.org for RoboHelp and Authoring tips

     

     

    @petergrainge

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 21, 2013 6:56 AM   in reply to OL-Lachance

    I think we mean the same thing. You start the search outside Rh and it then searches what is in Rh. I think there may be a way to do that but isn't the real requirement, regardless of search or highlighting, that when the user presses F1 or clicks an icon in your software, the help opens to the relevant page of the help?

     


    See www.grainge.org for RoboHelp and Authoring tips

     

     

    @petergrainge

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 21, 2013 7:30 AM   in reply to OL-Lachance

    That might make it considerably easier.

     

    Thanks for jumping in Peter. This might just save a lot of work.

     

    Greet,

     

    Willam

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 21, 2013 7:32 AM   in reply to OL-Lachance

    To help you I need to understand the workflow. So the user is in your software and presses F1 or an icon. You are saying you have a means to open the help at the right page so what is it you want highlighted. At this point all the user has done is press F1 or an icon, no search term has been entered so what would be highlighted?

     

    Is it that as Willam has suggested that when the user presses for help, they then enter a search term? If it is, then I can suggest a means of achieving what you want using a low cost third party tool.

     


    See www.grainge.org for RoboHelp and Authoring tips

     

     

    @petergrainge

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 21, 2013 8:21 AM   in reply to OL-Lachance

    OK what I had in mind is not what you want.

     

    Back to you Willam? Any ideas on this.

     


    See www.grainge.org for RoboHelp and Authoring tips

     

     

    @petergrainge

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 25, 2013 11:44 AM   in reply to Peter Grainge

    Hi,

     

    I think the following does what you require: You parse a word with the URL parameter search. The topic will then use the default search highlighting of all occurences in that topic. (Note that the script checks the topic's URL as well as the skin URL.) You can paste the script in a master page or in a separate file. The way it is set up, only place it last in the document though.

     

    <script type="text/javascript">

    var gup = function( name, url ) {

        var results = (new RegExp("[\\?&]"+name+"=([^&#]*)")).exec(url);

        if ( results == null ) {return ""}

        else {return results[1]}

    };

    var searchhighlight = gup("search", window.location.href);

    if(searchhighlight == "") { searchhighlight = gup("search", top.window.location.href);}

    if(searchhighlight != "") {

              setHighlightSearch = true;

              StartHighLightSearch(searchhighlight);

    }

    </script>

     

    Call using:

     

    http://www.example.com/topics/topic.htm?search=mysearchterm

     

    Greet,

     

    Willam

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points