Skip to main content
Known Participant
January 3, 2013
Question

Editing context in search results

  • January 3, 2013
  • 2 replies
  • 3018 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

    Hmmm, so let me see if I'm understanding this better.

    You have a topic with a Title of "Eggs are good for you" and the first bit of it begins with an explanation about what eggs are. So you generate and you see "Eggs are good for you" along with the first bit of text. But you would prefer the summary actually read differently.

    So to overcome this, you added text inside the topic and made certain it was at the very top of the topic and in one point size so it would basically be invisible when viewed or printed. And by doing so, perhaps now the search will present: "Eggs are good for you" along with your inserted (and invisible) text reading something differently. Perhaps: This topic will outline the benefits and reasons you want to eat eggs..

    Interesting thought. I'll have to play with that and see what happens... Rick


    That's exactly right!  To expand on your example, if I did nothing at all, my summary would begin with the words "All About Breakfast Foods," because that's the header on the master page that appears throughout my Web Help.  (So those would be the first words of the summary for the egg topic, the bacon topic, the oatmeal topic, etc.)   Then it would say "Eggs are good for you."  Then it would have a few words of text, such as "Chickens lay eggs..."   And then it runs out of room.

    What I want is for it to present "Eggs are good for you" as the bold title of the topic, and then a new summary, such as, "Doctors say eating eggs can make you smarter and more handsome."  I'm trying to fool RoboHelp into thinking that those are the first words of the topic, because the first words of the topic are what it uses when it generates the summary. 

    I just want to be sure that if I do this, it won't break something else. 

    Funny, but even though it's 3 p.m. where I am, I suddenly have a taste for a nice omelet.