Hello everyone!
I am new at development macro, so I need help.
I've made a simple "container" macro with my custom styles (like as "info macro" etc). It has only to mark inputted text on pages. Now I need to display this macro at page, but my way doesn't work.
My Java-code is:
public String execute(Map map, String s, ConversionContext conversionContext) throws MacroExecutionException {
return VelocityUtils.getRenderedTemplate("templates/new-info-macro.vm", map);
}
public boolean hasBody()
{
return true;
}
@Override
public BodyType getBodyType()
{
return BodyType.RICH_TEXT;
}
@Override
public OutputType getOutputType()
{
return OutputType.BLOCK;
}
VM:
<div class="NewInfoBlock">
$body
</div>
When I put my macro in page in editing mode and insert some text in it, everything is OK. But when I update page I see only $body instead of inputted text.
Where is an error?
Desicion:
public String execute(Map map, String body, ConversionContext conversionContext) throws MacroExecutionException {
map.put("body",body);
return VelocityUtils.getRenderedTemplate("templates/new-info-macro.vm", map);
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.