Expand macro - How to Expand all on Confluence page?

Maria Ahvenlampi September 30, 2022

Hello, is there any way to expand all the Expand macros within one confluence page?

We have some pages that has a lot of information and the page content has been divided by using Expand macro. 

Now the problem is that when we are using the Find- shortcut (ctrl + F) the data that is entered inside the macro does not appear on the search without expanding all the macros...

I have tried the book mark- thing without success... https://medium.com/@timcameron/expanding-all-in-confluence-db0d3cd711f0

Thanks in advance! :) 

2 answers

1 accepted

2 votes
Answer accepted
Clark Everson
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 30, 2022

Hi Maria,

There is no way to expand all by default with built in confluence functionality. You maybe able to script this using something like scriptrunner but it would need development work.

Alternatively the way i would do this is for everything in the excerpts make a unique page. Then I would make two parent pages, one that uses excerpts, and inside the excerpt us the include page macro (i think is the name) and another one that is just all include page macros. That way you get both options but you only need to edit the data once!

Best,

Clark

Maria Ahvenlampi October 3, 2022

Hello Clark, and thanks for your answer. 

I will go with the include- macro option :) Thanks!

Br,

Maria A

Dave Poole December 2, 2022

If the Expand macro had a property to allow it to be set open or closed that would be incredibly useful.

Is this the forum to make a feature request?

This is a question I get asked frequently by our clients.  At present I have to explain that you either get a page with everything collapsed or you don't have expand/collapse capability.

1 vote
Glenn Morrow October 8, 2023

https://medium.com/@timcameron/expanding-all-in-confluence-db0d3cd711f0 has an updated version in the comments. Also I (before I saw that) made one also. The problem is it runs externally to Atlassian so each use has to set up the bookmark to use to do this - not the friendliest/most scalable thing in the world ... but it does work.

javascript:(function(){document.querySelectorAll("[data-node-type='expand']").forEach(function(n){ n.querySelectorAll("button")[0].click();})})()

The Atlassian request for this proper is at https://jira.atlassian.com/browse/CONFCLOUD-27077 - you can always upvote on that too.

Glenn Morrow October 8, 2023

This forum won't allow the colon after "javascript" above - so replace ":" with a ":" when you use it. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events