Page 1 of 1

Author 14.2: Hide search tab in webhelp output

Posted: Tue Dec 17, 2013 7:11 pm
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

Re: Author 14.2: Hide search tab in webhelp output

Posted: Wed Dec 18, 2013 1:24 pm
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

Re: Author 14.2: Hide search tab in webhelp output

Posted: Mon Jan 18, 2016 6:13 am
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

Re: Author 14.2: Hide search tab in webhelp output

Posted: Mon Jan 18, 2016 10:28 am
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

Re: Author 14.2: Hide search tab in webhelp output

Posted: Wed Feb 03, 2016 4:05 pm
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

Re: Author 14.2: Hide search tab in webhelp output

Posted: Thu Feb 04, 2016 3:18 pm
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

Re: Author 14.2: Hide search tab in webhelp output

Posted: Fri Feb 05, 2016 1:44 pm
by Michael95
Worked like a dream....
Thank you so much

Regards,
Michael