Edit online

How to Add Tweet Button in WebHelp Classic Output

It is possible to integrate X (formerly known as Twitter) into your WebHelp Classic output and the widget will appear in the footer section of your WebHelp page.

Using Oxygen XML Editor/Author

To add a X Tweet widget to your WebHelp Classic output using a transformation scenario from within Oxygen XML Editor/Author, follow this procedure:
  1. Go to the Tweet button generator page.
  2. Fill in the displayed form. The Preview and code area displays the code that you will need.
  3. Copy the code snippet displayed in the Preview and code area and paste it into a <div> element inside an XML file called tweet-button.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="twitter">
      <a href="https://twitter.com/share" class="twitter-share-button">Tweet</a>
      <script>
        <!-- 
          !function (d, s, id) {
          var
          js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location)
     ? 'http': 'https';
          if (! d.getElementById(id)) {
          js = d.createElement(s);
          js.id = id;
          js.src = p + '://platform.twitter.com/widgets.js';
          fjs.parentNode.insertBefore(js, fjs);
          }
          }
          (document,
          'script', 'twitter-wjs');
         -->
      </script>
    </div>
  4. In Oxygen XML Editor/Author, click the Configure Transformation Scenario(s) action from the toolbar (or the Document > Transformation menu.
  5. Select an existing WebHelp 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.
  6. Switch to the Parameters tab and edit the webhelp.footer.file parameter to reference the tweet-button.xml file that you created earlier.
  7. 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:
To add a X Tweet widget to your WebHelp Classic output using a script outside of Oxygen XML Editor/Author, follow this procedure:
  1. Go to the Tweet button generator page.
  2. Fill in the displayed form. The Preview and code area displays the code that you will need.
  3. Copy the code snippet displayed in the Preview and code area and paste it into a <div> element inside an XML file called tweet-button.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="twitter">
      <a href="https://twitter.com/share" class="twitter-share-button">Tweet</a>
      <script>
        <!-- 
          !function (d, s, id) {
          var
          js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location)
     ? 'http': 'https';
          if (! d.getElementById(id)) {
          js = d.createElement(s);
          js.id = id;
          js.src = p + '://platform.twitter.com/widgets.js';
          fjs.parentNode.insertBefore(js, fjs);
          }
          }
          (document,
          'script', 'twitter-wjs');
         -->
      </script>
    </div>
  4. Use the webhelp.footer.file parameter in your transformation script and set its value to reference the tweet-button.xml file that you created earlier.
  5. Execute the transformation script.