Forums

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

How do I set the Expand macro with html via the api?

Isaac Yep February 8, 2023

I would expect pushing this to the api:

<details>
  <summary> Click me to expand </summary>
  <p> I'm expanded now! Hooray! </p>
</details>

to set the Expand macro. It does not. That makes me sad. 

 

How do I set the Expand macro with html ( i'm using the API's python wrapper, if that matters).

2 answers

1 accepted

0 votes
Answer accepted
Isaac Yep February 9, 2023

For anyone reading this, the answer is:

<ac:structured-macro ac:name="expand">
  <ac:parameter ac:name="title">Expand me...</ac:parameter>
  <ac:rich-text-body>
    
<p>This text is hidden until you expand the section.</p>
  </ac:rich-text-body>
</ac:structured-macro>

which has been left out of recent versions of documentation. I found it in version 5 docs:
https://confluence.atlassian.com/conf59/expand-macro-792499106.html

0 votes
Ashish Bijlwan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 8, 2023

Hi @Isaac Yep 

Welcome to the Atlassian Community!

Please have look to https://developer.atlassian.com/server/confluence/confluence-rest-api-examples/ for confluence rest api examples. 

Also, check https://confluence.atlassian.com/doc/html-macro-38273085.html and see any of these helps you in anyway.

 

Thank you,
Ashish

Isaac Yep February 9, 2023

@Ashish Bijlwan 
Neither of those answer my question.

My question is, when I push html via api to a confluence page, it works just fine, however specifically for the Expand macro, the <details><summary> tags don't manifest into an Expand component.

For rich text things like:

{expand}hello world{expand}

does the page have to be in 'representation=wiki' ?

Basically, how do I define an Expand macro from html markup, if it's even possible at all?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events