Macro handling

Last modified by Raphaël Jakse on 2026/03/23 12:27

Explanation

Information

To help with cases where there is no direct equivalent in XWiki Standard, XWiki SAS, a sponsoring company of XWiki, has released the paying "Pro Macros" package which supports a set of Confluence Macros. See the "Warning" section in this document. In particular, if you see a "layout macro" error, this package will be very useful.

There are three main ways of handling macros coming from Confluence:

  1. bridges
  2. converters
  3. we have the same macro in XWiki

Bridges

By default, we convert macros to bridges:

  • the macro is named confluence_nnn, where nnn is the original name of the macro in Confluence
  • parameter are kept as is (or, more accurately, their values are converted to strings: in Confluence, parameter values can be arbitrary XML)

Converters

Confluence XML offers the possibility to write custom converters for macros, and provide quite a few of these converters. See Writing macro converters.

Same macro in XWiki and Confluence

It happens that we do have the same macro in XWiki as in Confluence, with compatible parameter names. It's usually very simple macros. This is for example the case for the html macro.
Confluence XML's "unprefixed macros" parameter can be used to tell Confluence XML not to prefix the macro. 

Information

By default, in Confluence XML, all macros are prefixed and the unprefixed macro parameter needs to be set. There's an issue to set a default value to this parameter so well known macros are not prefixed: https://jira.xwiki.org/browse/CONFLUENCE-250

If it's currently working for you and you are wondering why, it might be because tools you are using could be setting this parameter by default.

Macro handling policy

When dealing with a new macro from Confluence, we follow the current rule:

  • if the macro from Confluence has a compatible name and compatible parameters, "unprefixing" it can be considered
  • Otherwise, we consider writing a macro converter that will convert the macro to a macro implemented in XWiki standard or in a contrib extension.
Information

It is suitable to develop a new standard or contrib macro to implement a feature in XWiki equivalent to what the Confluence macro provides, but following the XWiki conventions, if none exist yet.

Warning

It is not suitable to implement a macro converter in Confluence XML to a macro that doesn't exist as a contrib or standard macro. In particular, XWIKI SAS implements macro converters in Confluence Migrator Pro for macros implemented in other "Pro" packages they provide, such as Pro Macros.

If nothing is done, then a bridge will be output. So far, no Confluence bridge is implemented in standard XWiki or in a contrib extension, which means the macro call will display an error because it's not implemented. There's nothing against implementing bridges in a contrib extension. XWiki SAS implements a few bridges as part of their Pro packages.

In short:

  • A macro converter is strongly preferred
  • implementing a bridge should only be considered if a macro converter would not be suitable for some reason

Get Connected