Select All Button for WebHelp

Are you missing a feature? Request its implementation here.
JeffR
Posts: 7
Joined: Thu Mar 13, 2014 4:23 pm

Select All Button for WebHelp

Post by JeffR »

I notice the forum has a "Select All" button for code snippets.

Can we get that functionality for the webhelp xform?
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Select All Button for WebHelp

Post by sorin_ristache »

Hello,

That functionality is not available in the Webhelp output. If you tell us where you would like to add this button in the Webhelp page I could tell you what XSLT file you need to modify for adding the button and the code that executes the button in the Webhelp transformation.


Regards,
Sorin
JeffR
Posts: 7
Joined: Thu Mar 13, 2014 4:23 pm

Re: Select All Button for WebHelp

Post by JeffR »

Hi Sorin,

I'd like to have a copycode button for every instance of the codeblock element.

It would all my readers to use code snippets with much more ease.

A useful example from MSDN: http://blogs.msdn.com/b/jpsanders/archi ... locks.aspx

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

Re: Select All Button for WebHelp

Post by sorin_ristache »

Hi,

You will have to customize this XSLT template:

Code: Select all

<xsl:template match="*[contains(@class, ' topic/pre ')]" mode="pre-fmt">
which is located in the file:

OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT\plugins\org.dita.xhtml\xsl\xslhtml\dita2htmlImpl.xsl

You should add a Copy Code button in the Webhelp pages next to the code snippets (the content of a codeblock element in a DITA XML topic) by overriding the above XSLT template with the standard XSLT overriding mechanism by adding an xsl:template element with the same attributes (<xsl:template match="*[contains(@class, ' topic/pre ')]" mode="pre-fmt">). You should add your overriding XSLT template in this file:

OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT\plugins\com.oxygenxml.webhelp\xsl\dita\desktop\fixup.xsl

This XSLT template should add the Copy Code button as XHTML code (for example a button element) and attach also the action code (JavaScript, etc) for copying the code snippet to the XHTML button.

Sorry, for now we don't have a more convenient/expedient way for this type of customization (adding a custom button, associated with a particular DITA XML element, in the content of a Webhelp page).


Regards,
Sorin
JeffR
Posts: 7
Joined: Thu Mar 13, 2014 4:23 pm

Re: Select All Button for WebHelp

Post by JeffR »

I don't seem to have the file structure required for the first part in 15.2

org.dita.xhtml contains 4 build files, conductor and plugin.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Select All Button for WebHelp

Post by sorin_ristache »

sorin wrote:You will have to customize this XSLT template:

Code: Select all

<xsl:template match="*[contains(@class, ' topic/pre ')]" mode="pre-fmt">
which is located in the file:

OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT\plugins\org.dita.xhtml\xsl\xslhtml\dita2htmlImpl.xsl
Sorry, in version 15.2 the correct file path is:

OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT\xsl\xslhtml\dita2htmlImpl.xsl

The file name is the same, it's just the directory structure that is a little different.


Regards,
Sorin
Post Reply