Skip to main content
Skip table of contents

Custom macro for page template

Why do I need this ?

By default, when writing a Confluence page layout for a Confluence page mapping, you can use the status macro to define placeholders for Elements Copy & Sync injectors.

It might not be the perfect solution for all users:

  • you might want to have a dedicated macro for this need and only use the status macro for its original need.
  • you want to promote the use of Elements Copy & Sync page templates in your company, and having a dedicated user macro is a good way to accomplish this goal

This page explain how to create a Confluence user macro that can be used to define placeholders for Elements Copy & Sync injectors.

How to configure ?

To configure an Elements Copy & Sync user macro in Confluence:

  • You need the administrator rights in Confluence
  • Go to the User Macros configuration page
  • Click on Create a User Macro


User Macros screen


  • Configure the User macro:


Copy and Sync user macro configuration


Macro Name

Something relevant to your user, we use elements-copy-sync-placeholder

Visibility

Make it visible to all users

Macro title

Name of the macro in the macro browser

Icon URL

https://marketplace-cdn.atlassian.com/files/images/e8268f92-afaf-4d21-af89-3df895becde2.png

Documentation URL

Configuring Confluence mappings

Macro Body Processing

No macro body - It is important to use this value, otherwise it won't work

Template

You can define your own layout, but it is mandatory to have the @param variable in the comments. Here is an example:  

XML
## Elements Copy & Sync placeholder macro
## @param variable:title=Variable|type=string|required=true|desc=Elements Copy & Sync variable <a href="https://doc.elements-apps.com/elements-copy-and-sync/latest/fields-mappings/configuring-confluence-mappings/page-velocity-variables" target="_blank">cheat sheet</a>
<span class="aui-lozenge aui-lozenge-current">$paramvariable<span>

We use the AUI lozenge component provide by AUI. You can use any CSS element provided by this library.

  • Click on Save

That's it, the user macro is available to all your Confluence users and can be used to create injector placeholders thanks to the Velocity variables.


Confluence mapping select user macro


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.