On converting wiki markup based user macros for use with Confluence 4
by David. Average Reading Time: about a minute.
Thomas Emil Hansen recently wrote How do I write a user macro with “sections” and “panels” using the 4.0 HTML template?
With Confluence 4, the storage format has changed from traditional wiki markup to an XML based storage format. This means that all those old wiki-markup based user macros are now overdue some TLC. Luckily, there’s always the “Insert Wiki Markup” dropdown in the Confluence editor to fall back on.
To convert your macro…
- Create a new page and use the “Insert Wiki Markup” function to add your wiki markup:
{section} {column} $body {column} {column:width=300px} {panel} *Contents:* {toc:maxLevel=3} {panel} {column} {section} - Save the page
- From the Tools menu, select View Storage Format. This will give you:
<ac:macro ac:name="section"> <ac:rich-text-body> <ac:macro ac:name="column"> <ac:rich-text-body> <p>$body</p> </ac:rich-text-body> </ac:macro> <ac:macro ac:name="column"> <ac:parameter ac:name="width">300px</ac:parameter> <ac:rich-text-body> <ac:macro ac:name="panel"> <ac:rich-text-body> <p><strong>Contents:</strong></p> <ac:macro ac:name="toc"> <ac:parameter ac:name="maxLevel">3</ac:parameter> </ac:macro> </ac:rich-text-body> </ac:macro> </ac:rich-text-body> </ac:macro> </ac:rich-text-body> </ac:macro> - Paste this into your user macro rather than the old-fangled wiki markup.
- Repeat this procedure for all user macros you wish to convert.




[...] David Simpson – On converting wiki markup based user macros for … David Simpson – On converting wiki markup based user macros for … Thomas Email Hansen recently wrote How do I write a user macro with “sections” and “panels” using the 4.0 HTML template?. With Confluence 4, the storage format has changed from traditional wiki markup to an XML based … Read Full Updates On This Blog [...]
Thank you for this helpful tip!
[...] to the information on this page for this great tip. This entry was posted in macros. Bookmark the permalink. ← Change [...]
Is it possible to use this new xml macro syntax in server-side velocity templates, in a macro-module of some plugin. Like using the function VelocityUtils.getRenderedTemplate(template, context);? If yes, could you, please tell me how? (When I simply write xml macro code in velocity template it just passes that xml to the page without rendering of the macro.)
I’m not sure why you’d want to do this — please explain so I can have a go at answering this.