Page 1 of 1

Adding javascript just before closing body tag

Posted: Tue Nov 24, 2015 11:20 pm
by kmank
Hi,
Using O17.1, I'm trying to add a script just before the closing body tag of all webhelp topics. Searching the forum, I cannot locate the file in which to place the code.
Any help is greatly appreciated!

Re: Adding javascript just before closing body tag

Posted: Wed Nov 25, 2015 12:47 pm
by bogdan_cercelaru
Hello,

I've logged your request on our issue tracking tool to be analyzed.
Until it is implemented you can use the webhelp.footer.file parameter as a workaround.
The content of the file referred by this parameter should look like:

Code: Select all


<script type="text/javascript">
/* Your code goes here */
</script>


Regards,
Bogdan

Re: Adding javascript just before closing body tag

Posted: Wed Nov 25, 2015 7:36 pm
by kmank
thank you Bogdan - this certainly could be a resolution. However, this morning I located where it needed to be:

dita2webhelp.xsl needed to be modified in <xsl:template match="/|node()|@*" mode="gen-user-footer"> .
Simply placing the javascript code before </xsl:template> allowed the script to appear immediately before the output </body> tag.

This allows for the end result without needing to deliver another file to the authors.

Thanks again for your direction.