I'm exploring the RC3 version of confluence 4.0, to get a handle on what's required to upgrade when the stable version is launched.
All is good so far, but I'm a little confused by the changes to the "user macro", which no longer appears to support wiki markup as an output format (just HTML now). I have a series of macro's that were created (not by myself) which are all using standard wiki markup in the macro template.
my question is - does this really need to be converted to HTML or is there somethgin I'm missing in the beta documentation?? For example - one macro uses the following template:
{panel:title=On this page|borderStyle=solid|borderColor=#3C78B5|titleBGColor=#eeeeee|bgColor=#ffffff} {toc:minlevel=2|maxLevel=$body} {panel}
As you can see it used two wiki markup macros {panel} & {toc}. Surely I dont have to construct these manually now using HTML do I?? Does anyone have an example of mixing HTML with wiki markup macros to extened the confluence feature set (in my case to create a stanbdard look / feel for page headers).
Apologies if this is a noob question - i'm just not getting it??
If you want to be ahead of the game and get your user macros over to 4.0 as early as possible (good on you! :-) )then you could make use of the 'view-storage-format' plugin.
You need to be an admin to do this...
Hi Paul,
with 4.1.3, that wont work for usertemplates. I pasted the XHTML and it was stored like "code" tagged content - unrendered.
Once i manually wrote it down as wikimarkup, using the XHTML just as reference source for macronames and parameternames, it worked.
Alternative I prefer : use the 3.5. Documentation to read up the wiki-markup codes
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Josch.
I have just checked and this still work with 4.1.3 and newer. Remember you need to set the macro body processing to 'Rendered'
(The explanation on the screen says it best: The body will be rendered so most HTML entered will be passed to the template unmodified but Confluence specific mark up such as macro definitions will be rendered.).
I hope that helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi there.
You can actually leave your wiki formatted user macros as they are at the moment.
The administration screen will show you a warning stating -
"For these macros to continue working in future versions of Confluence they must be manually changed to use HTML templates."
Since we don't have the XHTML Editor enabled in places such as user macro creation we have left support for wiki markup in the meantime. It is unlikely that we will drop support for wiki markup in user macros until we offer a more feasible alternative to expecting you to enter XHTML formatted data into a plain textarea.
(This is being investigated for 4.1 but I can make no guarantees at this stage of when it might be ready.)
Finally though, for your user macro to be readily available in the new 4.0 Editor you will need to make sure you have configured Macro Browser metadata. See the Quick Administrator Tips for more details.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm afraid you will need to convert them - 4.0 doesn't have wiki markup any more. I haven't tried it myself, but there is a macro that will let you use markup inside it, so maybe wrapping that into your macros might help, but in the long run, you should convert to HTML
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the feedback Nic, appreciate your insight here. One further question if you don't mind. How can i leverage standard features within confluence, such as table of contents {toc} (as in my example) - will I essentially have to make calls to the API using java like syntax? just want to get a handle on what sort of challenge i'm setting my self up for.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The "correct" way to make use of other macros within a new user macro is to specify it in XHTML format.
So for a toc macro with all default parameters you would specify -
<ac:macro ac:name="toc" />
To set a style on the toc macro -
<ac:macro ac:name="toc"><ac:parameter ac:name="style">circle</ac:parameter></ac:macro>
You can probably derive the pattern for specifying further parameters.
Obviously this could get unweildy pretty quickly which is why we hope to get a proper Editor available soon.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, how to call body of the macro? In my macro I use the info macro .
<ac:macro ac:name="info"> BODY? </ac:macro>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Alexander,
I believe that would be:
$body
More information: http://confluence.atlassian.com/display/CONF35/Writing+User+Macros#WritingUserMacros-Template
Tobbi G.
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.