I have a user macro created in the Confluence Admin UI. How do I add it to a Confluence plugin?
I tried creating a macro using the Confluence tutorial, but the tutorial shows how to return a String as HTML. I even tried rendering my user macro .vm file in the plugin using Velocity helpers, but I don't seem to have the same context (no $content for example).
Please help!
Solved the problem using the context passed into the execute method:
public String execute(Map<String, String> parameters, String body, ConversionContext context) throws MacroExecutionException {
PageContext pageContext = context.getPageContext();
contextMap.put("content", pageContext.getEntity());
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.