I took advantage of something that happens in Flare's WebHelp output whenever a search result is found: It will automatically "unhide" any hidden blocks in the HTML and highlight the search term. That means if you have a div of which the style is "display:hidden;", that style will be removed by Flare's javascript, the search term result will be wrapped in a span and highlighted in yellow.
Considering I had well over 200 error codes for one software in particular, the following method generated a clean, pretty message for the user.
1. The HTML
The hint here it to build your sentence and, in the middle of it, throw in a bunch of hidden spans with your results in them. Example:
Code: Select all
<p>Search results for <strong><span style="display:hidden;">ERR001</span><span style="display:hidden;">ERR002</span><span style="display:hidden;">ERR003</span></strong> can be found in the Knowledge Base. Click <a href="/en/knowledgebase/" id="kbLink">here</a> to try your search in the KB.2. Javascript Magic
I didn't like the idea of telling people "go in the KB and do your search again", so I cheated a little: I used Javascript to grab the highlighted result from the URL query string and re-built a link so that when the client clicked on it, they would be redirected to the search results with that same word directly.
Code: Select all
<script type="text/javascript"><!--
function getURLParameter(name) {
return decodeURI(
(RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1]
);
}
var searchResult = getURLParameter("Highlight");
$("#kbLink").attr("href", "/EN/knowledgebase/search/"+searchResult);
-->
</script>3. Going Further
While I decided to let the users click the link automatically, it would have been very trivial to change the javascript so that it would redirect the user after a couple of seconds or, even further, automatically without even displaying the page (in which case the invisible spans would have been useless and only the second point would have been necessary).
You could also create one page per manual you want to redirect to, have a bunch of keywords on each of those pages and call each page "Search Results in Manual X", if that tickles your fancy.
Enjoy! (Oh, btw, your results may vary, I'm not responsible if anything happens, this is provided as is with no support, etc etc. You know the drill!)