Skip to main content
Known Participant
January 3, 2013
Question

Editing context in search results

  • January 3, 2013
  • 2 replies
  • 3014 views

I'm working in RoboHelp 10.  When generating the output, I check "Show Context in Search Results."  When someone searches for a term, they get a list of each topic where that term appears, and they see a short summary of the text from that topic.  However, the summary includes words from a header on a master page, and it includes the words in an <h1> headline, which is the same as the title of the topic.  So the summary is almost useless.  Is there a way to exclude content from a master page or a style in the search results?  Better still, is there a way to write a separate summary of the topic that will appear instead of the first few words in the topic?

    This topic has been closed for replies.

    2 replies

    Participant
    March 7, 2015

    Hello. Yes, hugely annoying. Also calling 60 characters of context a "default" is misleading given that you cannot change it :-}} What did you end up doing? I liked your invisible text idea.....did it work? I also liked your suggest of adding Context as a property of the Topic.

    Known Participant
    January 4, 2013

    I think I've found the answer to this problem!

    First, I added this to the .css file:

    p.invisible {

    font-size: 1pt;

    color: #ffffff;

    float: none;

    margin-top: 0px;

    margin-bottom: 0pt;

    }

    Then, I opened the RoboHelp topic in HTML view, and put this in the line right after <body>, before the line that says <?rh-placeholder type="header" ?> :

    <p class="invisible">I type the summary of the topic here.</p>

    I generated the WebHelp, and it worked!  So what it's actually doing is typing the summary in 1-point white type at the top of the page, which no one can see.  I tried printing out the page and that worked fine too.

    Before I do this on a live project, can anyone think of any negative consequences to this workaround?  Would it interfere in any way with any of the other output types?  Is there any reason to NOT do it? 

    Captiv8r
    Legend
    January 4, 2013

    Hi there

    The downside I might think of first is that by making this change you are also causing the text that is on the topic itself to become invisible, no? So if you don't want to see the text when viewing the topic itself, why even have it there to begin with? I might just consider removing it using other means than simply hiding it via CSS. But maybe I'm missing something?

    Cheers... Rick

    Known Participant
    January 4, 2013

    Thanks for your reply.  I think it might be hard to visualize, so here's what I'm trying to accomplish:

    The words in the summary don't have to appear in the topic.  However, if they aren't in the topic, RoboHelp makes its own summary by taking the header from the master page -- which is the same for every topic! -- and then the <h1> headline, which is the same as the topic title, and then the first few words of the text of the topic.  Then it runs out of room. So the system-generated summary won't give much additional information about what the overall topic is about.  If I do it this way, I can say a few words to summarize the topic. 

    I'm actually a little reluctant to use this workaround, but it appears that RoboHelp does not let you edit what is presented when you select "Show Context in Search Results."  If it insists on displaying the first few words of the topic, I figure I'll put my real words in there, and make them invisible.  The next-best option, quite frankly, is to uncheck "Show Contents in Search Results," and not show a summary at all.