Is there a way to use the Expand Macro and have the page always Expand by Default?
Asked by Stacey Shearn:

I have a page that I would like to show all of the Expand/Collapse as Expanded. Right now, when visiting the page, they all show as Collapsed.


Answers:
author: Thomas Bowskill
body: Hi [@Stacey Shearn](/t5/user/viewprofilepage/user-id/2692833) , not with the Atlassian Expand macro, but there is a free plugin called [Refined Toolkit](https://marketplace.atlassian.com/apps/1211136/refined-toolkit-for-confluence), which has a [UI Expand macro](https://docs.refinedwiki.com/display/rwui/UI+Expand) with the property that lets you have it default-expanded (and the expand generally looks nicer).

If you are the admin / can convince your admin then I recommend giving it a shot

comments: author: Stacey Shearn
body: Thank you for the help Thomas! I will look into this solution, and check with our Admins. One of the things that was suggested was to have a button (or something clickable) that would expand everything on a particular page. I will check out this solution and see if it does that as well.


author: Thomas Bowskill
body: Best of luck with that [@Stacey Shearn](/t5/user/viewprofilepage/user-id/2692833) -- I did have a few similar tools I have created but were a bit 'hacky' and ended up with the HTML macro being used, which generally has the downfall of being too custom (with Confluence I've found it always best to have as much standardisation as possible). When I installed Refined Toolkit it eliminated these custom hacks I had made -- they also have button macros.

Just to double check -- do you use the [Table of Contents macro](https://confluence.atlassian.com/doc/table-of-contents-macro-182682099.html) much? As it could be another way of solving your issue: put that at the top of your pages and then people will have clickable hyperlinks to the section they need -- I use these on most my lengthy documents, and expand is reserved for code snippets, or data that not everyone needs to skim past.

*and P.S. if the answer helps, there should be something like an 'Accept this Answer' button*


author: Stacey Shearn
body: I like the Table of Contents answer! I will try that! Thank you Thomas!


author: Steffen Heller
body: I have a similar question:

I need to create a PDF of the UI expand macro with all the menus expanded. Right now, the menus are all closed when I export even if they were expanded before exporting.

So, the question is not how to expand the menus but how to keep that setting when exporting.

Any ideas?

I figured the macro works with javascript. Simply deactivating javascript in the browser did not work. Doing that, the whole page would disappear for some reason.

Adding a custom javascript button to expand all menus could perhaps work. But I don't see a way to add javascript to my page as I don't seem to have any macro for that.


author: Stefan Kopec
body: [Refined Toolkit](https://marketplace.atlassian.com/apps/1211136/refined-toolkit-for-confluence), which has a [UI Expand macro](https://docs.refinedwiki.com/display/rwui/UI+Expand) is not free any more. Verified August 2021.


author: Stefan Kopec
body: [Refined Toolkit](https://marketplace.atlassian.com/apps/1211136/refined-toolkit-for-confluence), which has a [UI Expand macro](https://docs.refinedwiki.com/display/rwui/UI+Expand) is not free any more. Verified August 2021.


Tags: cloud

confluence-cloud