I have a very basic macro that is used on many, many pages in our Confluence 3.5 instance. I've read this page: Upgrading and Migrating an Existing Confluence Macro to 4.0 which is all very well for complicated macros that have been created as plugins.
My little macro was created entirely in the User Macro admin screen. It wraps a paragraph of text and displays a toc over on the right side of the page to save space.
The settings are:
{section}{column:width=60%} $body {column}{column} {panel:bgColor=#FFF2F0|borderColor=white}{toc:style=circle|maxLevel=3}{panel} {column}{section}
and that's it.
My question is: do I have to go through all that rigmarole of creating a plugin (creating XML files and building a jar) in order to test a migration from 3.5 to 4.x to 5.x ?
<ac:macro ac:name="section"> <ac:rich-text-body> <ac:macro ac:name="column"> <ac:parameter ac:name="width">60%</ac:parameter> <ac:rich-text-body> <p>$body</p> </ac:rich-text-body> </ac:macro> <ac:macro ac:name="column"> <ac:rich-text-body> <ac:macro ac:name="panel"> <ac:parameter ac:name="bgColor">#FFF2F0</ac:parameter> <ac:parameter ac:name="borderColor">white</ac:parameter> <ac:rich-text-body> <p> <ac:macro ac:name="toc"> <ac:parameter ac:name="style">circle</ac:parameter> <ac:parameter ac:name="maxLevel">3</ac:parameter> </ac:macro> </p> </ac:rich-text-body> </ac:macro> </ac:rich-text-body> </ac:macro> </ac:rich-text-body> </ac:macro>
You can add the above code to your Confluence 4.x user macro :) Ensure that the Macro Body Processing option is set to "Rendered"
How did I do this?
the point on doing the above is that, Confluence 4.x and above user macros do not use wiki markup anymore. So we need to use the equivalent of XHMTL code for that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you very much, Amalia. I'm a wiki-markup virtuoso, but I haven't had time to teach myself Confluence-flavoured XHTML. I appreciate your help with this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've since learned that adding this line to the top of the code means the macro will be displayed in the macro browser, otherwise it doesn't appear.
## @noparams
But now I've got another problem with this macro. When it was built using wiki markup, you could have up to 3 levels of headings inside the left column, and they would appear in the table of contents in the usual way.
But if you use the macro as written above, headings don't render after you save the page. They're perfectly visible and formatted correctly while you're editing the page. But once the page is saved, the headings (a) disappear as if they don't exist and (b) are not in the table of contents.
This means the macro has lost functionality and I will have to manually edit 50+ pages to restore the headings that were in them.
So I've reverted back to the wiki-markup version of the macro. Any thoughts on why that might be happening?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.