Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to render a Macro with body in page content layout?

Michael Yang - Shinetech Software
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
August 8, 2019

I am developing a Macro module, and want to apply this macro for all pages of a space by add this macro to page layout (Space tool -> Look and feel). My macro needs a body like Table of Content Zone. 

I tried to add macro to this part in the layout:

## VIEW

.........

<div id="main-content" class="wiki-content">
$body
</div>

 

My macro works when I use a macro without body like toc. I already make my macro as xhtml maro and wiki macro. But my Macro has to have the html of page content as input.

<div id="main-content" class="wiki-content">

$help.renderConfluenceMacro("{toc}")

$body

</div>

 

But it doesn't work for a macro with body for my macro and also Table of Content Zone:

<div id="main-content" class="wiki-content">
$help.renderConfluenceMacro("{toc-zone}$body{toc-zone}")
</div>

 

And I get empty string for the parameter body in this method of my macro:

String execute(Map parameters, String body, RenderContext renderContext)

 

Any one can help me? 

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events