Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Render a Macro in a User Macro

William Yeack
Contributor
November 15, 2018

I want to create a user macro that includes the rendered output of a different macro.  For instance:

## Macro title: Version Issues
## Macro has a body: N

## This is an example macro
## @Param Version:title=Version|type=string|required=true

<div>
$helper.renderConfluenceMacro("{cheese]")
</div>

 

However, this just prints out "$helper.renderConfluenceMacro("{cheese]")".  How do I get it to actually render the cheese (or another) macro?

1 answer

1 accepted

0 votes
Answer accepted
Thomas Schlegel
Community Champion
November 15, 2018

Hi @William Yeack,

the easiest way is using the Confluence Source Editor and then do something like this:

  • create a temporary page and put the cheese macro on that page
  • save the page, edit it again and open the source editor
  • there you can see that the cheese macro looks like this:
    • <ac:structured-macro ac:macro-id="3025afb4-6562-4aba-bc01-3668dfd87322" ac:name="cheese" ac:schema-version="1"/>
  • copy this and add it to your user macro like this:
    ## Macro title: My Cheese
    ## Macro has a body: N

    ## @noparams

    My Cheese:

    <ac:structured-macro ac:name="cheese" ac:schema-version="1"/>

    End of My Cheese, do something else

If you don't know the Confluence Source Editor, have a look at the marketplace. In my opinion, it's a must-have app (and it's free). 

William Yeack
Contributor
November 15, 2018

Nice one!

William Yeack
Contributor
November 15, 2018

s

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events