Webhelp Responsive - Changing Search HTML

Post here questions and problems related to editing and publishing DITA content.
mdslup
Posts: 167
Joined: Tue Mar 06, 2018 1:34 am

Webhelp Responsive - Changing Search HTML

Post 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?
cosmin_andrei
Posts: 138
Joined: Mon Jun 12, 2017 10:50 am

Re: Webhelp Responsive - Changing Search HTML

Post 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
Regards,
Cosmin
--
Cosmin Andrei
oXygen XML Editor and Author Support
mdslup
Posts: 167
Joined: Tue Mar 06, 2018 1:34 am

Re: Webhelp Responsive - Changing Search HTML

Post 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
radu_pisoi
Posts: 403
Joined: Thu Aug 21, 2003 11:36 am
Location: Craiova
Contact:

Re: Webhelp Responsive - Changing Search HTML

Post 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.
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Post Reply