How to Add a Google+ Button in WebHelp Responsive OutputEdit online
It is possible to integrate Google into your WebHelp Responsive output and you can specify where you want the widget to appear in your WebHelp page.
Using a Publishing Template
To add a Google+ widget to your WebHelp Responsive output using an Oxygen Publishing Template, follow
this procedure:
- Go to the Google Developers website.
- Fill-in the displayed form. The preview area on the right side displays the code and a preview of the widget.
- Copy the code snippet displayed in the preview area and paste it into a
divelement inside an XML file called google-plus-button.xml. Make sure that the content of the file is well-formed. The content of the XML file should look like this:<div id="google-plus"> <!-- Place this tag in your head or just before your close body tag. --> <script src="https://apis.google.com/js/platform.js" async defer></script> <!-- Place this tag where you want the +1 button to render. --> <div class="g-plusone" data-annotation="inline" data-width="300"></div> </div>
- Open the template descriptor file associated with your publishing template.
- Use one of the parameters that begin with webhelp.fragment in the
html-fragments section of the descriptor file. Set the value of that parameter
to reference the google-plus-button.xml file that you created
earlier.
<publishing-template> ... <webhelp> ... <html-fragments> <fragment file="HTML-fragments/google-plus-button.xml" placeholder="webhelp.fragment.after.toc_or_tiles"/> </html-fragments> </webhelp> - Open the DITA Map WebHelp Responsive transformation scenario.
- Click the Choose Custom Publishing Template link and select your template.
- Click OK to save the changes to the transformation scenario.
- Run the transformation scenario.
Using a Transformation Scenario in Oxygen XML Editor/Author
To add a Google+ widget to your WebHelp Responsive output using a transformation
scenario from within Oxygen XML Editor/Author, follow this procedure:
- Go to the Google Developers website.
- Fill-in the displayed form. The preview area on the right side displays the code and a preview of the widget.
- Copy the code snippet displayed in the preview area and paste it into a
divelement inside an XML file called google-plus-button.xml. Make sure that the content of the file is well-formed. The content of the XML file should look like this:<div id="google-plus"> <!-- Place this tag in your head or just before your close body tag. --> <script src="https://apis.google.com/js/platform.js" async defer></script> <!-- Place this tag where you want the +1 button to render. --> <div class="g-plusone" data-annotation="inline" data-width="300"></div> </div>
- Edit the DITA Map WebHelp Responsive transformation scenario and choose a template.
- Switch to the Parameters tab. Depending on where you want to display the button, edit one of the parameters that begin with webhelp.fragment. Set that parameter to reference the google-plus-button.xml file that you created earlier.
- Click Ok and run the transformation scenario.