How to Add a Facebook Like Button in WebHelp Classic Output
It is possible to integrate Facebook™ into your WebHelp Classic output and the widget will appear in the footer sections of your WebHelp page.
Using Oxygen XML Editor/Author
To add a Facebook™
Like widget to your WebHelp output using a transformation scenario from within
Oxygen XML Editor/Author, follow this procedure:
- Go to the Facebook Developers website.
- Fill-in the displayed form, then click the Get Code button.
- Copy the two code snippets and paste them into a
<div>
element inside an XML file called facebook-widget.xml. Make sure you follow these rules:- The file must be well-formed.
- The code for each
<script>
element must be included in an XML comment. -
The start and end tags for the XML comment must be on a separate line.
The content of the XML file should look like this:<div id="facebook"> <div id="fb-root"/> <script> <!-- (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.0"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); --> </script> <div class="fb-like" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"/> </div>
- In Oxygen XML Editor/Author, click the Configure Transformation Scenario(s) action from the toolbar.
- Select an existing WebHelp Classic transformation scenario (depending on your needs, it may be with or without feedback) and click the Duplicate button to open the Edit Scenario dialog box.
- Switch to the Parameters tab and edit the
webhelp.footer.file
parameter to reference the facebook-widget.xml file that you created earlier. - Click Ok and run the transformation scenario.
Using a Script Outside of Oxygen XML Editor/Author
Important: Running WebHelp transformations from a script outside of Oxygen XML
Editor/Author requires an additional license and some additional setup:
- You must have a valid license for the Oxygen XML WebHelp Plugin (https://www.oxygenxml.com/buy_webhelp.html).
- The Oxygen XML WebHelp Plugin must be installed and integrated.
To add a Facebook™
Like widget to your WebHelp output using a script outside of Oxygen XML
Editor/Author, follow this procedure:
- Go to the Facebook Developers website.
- Fill-in the displayed form, then click the Get Code button.
- Copy the two code snippets and paste them into a
<div>
element inside an XML file called facebook-widget.xml. Make sure you follow these rules:- The file must be well-formed.
- The code for each
<script>
element must be included in an XML comment. -
The start and end tags for the XML comment must be on a separate line.
The content of the XML file should look like this:<div id="facebook"> <div id="fb-root"/> <script> <!-- (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.0"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); --> </script> <div class="fb-like" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"/> </div>
- Use the
webhelp.footer.file
parameter in your transformation script and set its value to reference the facebook-widget.xml file that you created earlier. -
Execute the transformation script.