Page 1 of 1
Select All Button for WebHelp
Posted: Tue Apr 08, 2014 9:52 pm
by JeffR
I notice the forum has a "Select All" button for code snippets.
Can we get that functionality for the webhelp xform?
Re: Select All Button for WebHelp
Posted: Wed Apr 09, 2014 9:49 am
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
Re: Select All Button for WebHelp
Posted: Wed Apr 09, 2014 9:43 pm
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!
Re: Select All Button for WebHelp
Posted: Thu Apr 10, 2014 1:34 pm
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
Re: Select All Button for WebHelp
Posted: Thu Apr 10, 2014 9:08 pm
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.
Re: Select All Button for WebHelp
Posted: Fri Apr 11, 2014 9:17 am
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