Can I use a user macro as a placeholder and replace it with an xhtml macro afterwards?

hi,

we are now using some (velocity-driven) user macros but I'd like to replace them with a more powerful (java-based) xhtml-macro later on.

Is it possible to declare the xhtml-macro in a way that it can substitute the user macro, given that it has the same parameters?

2 answers

1 accepted

Yes, I have done something similar where I started with a user macro, then repackaged it later as a plugin for easier deployment. And yes it is recommended to delete the user macro code before.

I did some research on my own: Although I am not aware of any undiscovered side-effects, this appears to work. (When loaded via atlas-mvn package) the xhtml-macro appears to take precedence over an existing user code macro in view&edit mode. However I guess it might be a better idea to delete the user macro first and then register an xhtml macro with the same name - at least with 6.0.2 this worked well.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

995 views 23 13
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you