Question

How can I insert a export button to a Confluence page to directly export with defined setting?

Answer

If you want to render a export button to a Confluence page, you have to create a user macro, define the wanted Export Scheme and insert the macro to the Confluence page.

To create the user macro:

  1. Click the cog icon at top right of the screen and select Confluence Admin.
    The Administration Console is displayed.
  2. In the Configuration section, click User Macros.
    The screen User Macros is displayed.
  3. Click Create a User Macro.
  4. Enter a Macro Name.
  5. Activate the option Visible to all users in the Macro Browser.
  6. Enter a Macro Title.
  7. (Optional) enter a Description.
  8. Select Confluence Content in the drop-down Categories.
  9. (Optional) enter an Icon URL.
  10. Enter the URL of this page in the field Documentation URL.
  11. Activate the option No macro body.
  12. Replace the code in the field Template with the following code:

     ## @noparams 
    <ac:macro ac:name="scroll-ignore"><ac:rich-text-body> 
    <p><a class="scroll-chm-launcher" data-export-scheme-id="ENTER_EXPORT_SCHEME_ID_HERE" href="#">Export to CHM</a></p></ac:rich-text-body></ac:macro>
    CODE

    (info) Don't forget to insert your wanted Export Scheme ID in the code above.

  13. Click Save.
    The macro is now saved and can be inserted to Confluence page.

To use the macro in a Confluence page:

  1. Open the wanted Confluence page.
  2. Insert the macro where you want the export button to be rendered.
  3. Save the page.

The export button is now displayed on the Confluence page. If you click the button, the content gets exported with the defined Export Scheme.