Author 14.2: Hide search tab in webhelp output

Having trouble installing Oxygen? Got a bug to report? Post it all here.
mpeters-pivotal
Posts: 3
Joined: Tue Dec 17, 2013 7:07 pm

Author 14.2: Hide search tab in webhelp output

Post by mpeters-pivotal »

Hi,

This may seem like an odd question, but I'd like to hide the search tab in webhelp output. We insert a Google search bar in each page and don't require the separate search tab. How could I hide the search tab? I tried temporarily removing related templates from the frameworks\dita\DITA-OT\plugins\com.oxygenxml.webhelp\xsl\createMainFiles.xsl stylesheet using comment tags, but the output still includes the search tab.

Thanks,
Mark
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Author 14.2: Hide search tab in webhelp output

Post by sorin_ristache »

Hi Mark,

You can remove the Search tab in Webhelp output in version 14.2 by adding the following line:

Code: Select all

document.getElementById('search').style.display = "none";
at the end of the JavaScript function showMenu(displayTab) in file:

[Oxygen-14.2-install-dir]\frameworks\dita\DITA-OT\plugins\com.oxygenxml.webhelp\oxygen-webhelp\resources\js\tocWDiv.js

This works for the index.html main file of the Webhelp output. If you use the index_frames.html file you have to add the same line at the end of the same JavaScript function in the file toc.js located in the same directory.


Regards,
Sorin
Michael95
Posts: 4
Joined: Fri Aug 21, 2015 3:33 pm

Re: Author 14.2: Hide search tab in webhelp output

Post by Michael95 »

I really need to hide the search tab from our webhelp delivery. The solution you have provided doesn't seem to work for OxyGen Author 16.1
Your earliest reply is much appreciated.

Thanks
Michael
bogdan_cercelaru
Posts: 222
Joined: Tue Jul 01, 2014 11:48 am

Re: Author 14.2: Hide search tab in webhelp output

Post by bogdan_cercelaru »

Hello Michael,

The showMenu(displayTab) function was moved in the DITA_OT/plugins/com.oxygenxml.webhelp/oxygen-webhelp/resources/js/toc.js file in version 16.1
You can hide the Search tab by adding the following code at the end of this function.

Code: Select all

document.getElementById('search').style.display = "none";
This works for index.html and index_frames.html files of the Webhelp output.

Regards,
Bogdan
Bogdan Cercelaru
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Michael95
Posts: 4
Joined: Fri Aug 21, 2015 3:33 pm

Re: Author 14.2: Hide search tab in webhelp output

Post by Michael95 »

Thanks Bogdan. I tried to hide the search tab as per your guidance as follows:
function showMenu(displayTab) {
debug('showMenu(' + displayTab + ');');
if(notLocalChrome){
parent.termsToHighlight = Array();
}
...
...
...
if (displayTab == 'index') {
$('#id_search').focus();
searchedWords = "";
$("#bck_toc").css("overflow", "hidden")
$("#bck_toc,#bck_toc #searchBlock").css("height", "100%");
var hAvailable = parseInt($("body").height())-parseInt($("#header").height())-parseInt($("#indexForm").height())-parseInt($("#indexForm").css("padding-top"))-parseInt($("#indexForm").css("padding-bottom"));
$("#iList").css("height", hAvailable);
$("#iList").append($("#leftPane .footer"));
}
// Without Frames: Show left side(toc, search, index) if hidden
if ($("#frm").length > 0) {
toggleLeft();
}
}
document.getElementById('search').style.display = "none";


But the search tab is still showing when I run the standard DITA Map Webhelp transformation. Am I missing something here.

Thanks for your help with this,
Michael
bogdan_cercelaru
Posts: 222
Joined: Tue Jul 01, 2014 11:48 am

Re: Author 14.2: Hide search tab in webhelp output

Post by bogdan_cercelaru »

Hello,

Move the line

Code: Select all

document.getElementById('search').style.display = "none";
one line up, right before the closed curly bracket. The showMenu function should look like:

Code: Select all


function showMenu(displayTab){
...
if ($("#frm").length > 0) {
toggleLeft();
}
document.getElementById('search').style.display = "none";
}
Regards,
Bogdan
Bogdan Cercelaru
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Michael95
Posts: 4
Joined: Fri Aug 21, 2015 3:33 pm

Re: Author 14.2: Hide search tab in webhelp output

Post by Michael95 »

Worked like a dream....
Thank you so much

Regards,
Michael
Post Reply