Page 1 of 1

Webhelp Responsive - Changing Search HTML

Posted: Fri May 17, 2019 4:58 am
by mdslup
I'd like to edit some of the HTML for the Search bar in the Webhelp Responsive output. For example, the search bar has a tooltip that says "Please fill out this field."

https://i.imgur.com/NI4FhLd.jpg

However, I searched all through the plugins and could not find this text anywhere. Can anyone point me in the right direction?

Re: Webhelp Responsive - Changing Search HTML

Posted: Mon May 20, 2019 11:11 am
by cosmin_andrei
Hello,

The tooltip that appear is browser specific and it is obtained using the "required" attribute. This is an HTML5 attribute and you can find more information here :
https://developer.mozilla.org/en-US/doc ... _attribute

Unfortunately, this message cannot be easily customized, but it could be modified using a custom JavaScript. Please note that you have to develop your own JavaScript customization for this.

Best regards,
Cosmin

Re: Webhelp Responsive - Changing Search HTML

Posted: Tue May 21, 2019 4:17 am
by mdslup
I understand.

Followup question: Can I change some attributes of the search bar via an XSLT extension point?

I found the code that I want to edit in this file: ...com.oxygenxml.webhelp.responsive\xsl\template\commonComponentsExpander.xsl

However, I do not see this file on the list of possible extension points in the documentation: https://www.oxygenxml.com/doc/versions/ ... uyr_b1y_bx

Re: Webhelp Responsive - Changing Search HTML

Posted: Mon May 27, 2019 3:44 pm
by radu_pisoi
Hi,
mdslup wrote:
Tue May 21, 2019 4:17 am
Followup question: Can I change some attributes of the search bar via an XSLT extension point?
Yes, you can change some attributes of the search bar by overwriting the XSLT template that generate it. The template is located in
com.oxygenxml.webhelp.responsive\xsl\template\commonComponentsExpander.xsl

Code: Select all

 <!-- 
     Expand the 'webhelp_search_input' place holder. 
-->
<xsl:template match="whc:webhelp_search_input" mode="copy_template">
...

The customization XSLT stylesheet should be used from the following XSLT extension points:
* com.oxygenxml.webhelp.xsl.dita2webhelp - associated with the XSLT stylesheet (dita2webhelp.xsl) that produces an HTML file for each DITA topic.
* com.oxygenxml.webhelp.xsl.createMainPage - associated with the XSLT stylesheet (createMainPage.xsl) that produces the WebHelp Responsive main HTML page (index.html).
* com.oxygenxml.webhelp.xsl.createSearchPage - associated with the XSLT stylesheet (createSearchPage.xsl) that produces the WebHelp Responsive search HTML page (search.html).

See more details of WebHelp Responsive XSLT-Import and XSLT-Parameter Extension Points in our documentation.