Remove Highlighting from Search Results

Post here questions and problems related to editing and publishing DITA content.
pault
Posts: 70
Joined: Thu Mar 21, 2013 12:55 am

Remove Highlighting from Search Results

Post by pault »

When a user searches on a website generated from WebHelp Responsive, the search terms are highlighted in the result documents. This highlighten can be distracting. Is there a way to turn off the highlighting other than removing ?hl=term from the URL?

Thanks,

Paul
alin
Site Admin
Posts: 275
Joined: Thu Dec 24, 2009 11:21 am

Re: Remove Highlighting from Search Results

Post by alin »

Hello,

Unfortunately, there is no straight forward option that can be used to turn off the highlighting mechanism.

However, you can achieve this by editing the default template used to generate the WebHelp Responsive output:
  1. Open the JavaScript file that contains the code responsible for highlighting the search terms:
    [Oxygen-18.0-Installation-Directory]/frameworks/dita/DITA-OT2.x/plugins/com.oxygenxml.webhelp/templates/dita/bootstrap/resources/js/wt_default.js
  2. Change the value for the highlighted variable at line 2 to true.

    Code: Select all

    var highlighted = true;
The fix above is valid only if you are using DITA-OT 2.x as the current DITA Open Toolkit distribution. If you are using DITA-OT 1.8 you should edit the next file:
[Oxygen-18.0-Installation-Directory]/frameworks/dita/DITA-OT/plugins/com.oxygenxml.webhelp/templates/dita/bootstrap/resources/js/wt_default.js

You can check which version of DITA Open Toolkit you are using in the DITA preferences page (Main Menu -> Options -> Preferences...).
Alin Balasa
Software Developer
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply