Ability to expand all dropdowns within a confluence article

Jacob Schwartz
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 9, 2020

I've seen this posted on other forums, but I'm running into the following issue with the expand macro.

We use the expand macro to create drop downs in the SOPs, but it prevents our users from command + f on their macs or ctrl + f on their chrome books if the answer is within a drop down. 

I'm looking for a way to expand / collapse all dropdowns with one click of a button instead of having to select each one individually. 

Before there was a javascript recommendation within a bookmark, but it doesn't work: javascript:(function()%7B%24(%22.expand-control%22).each(function()%7B%20%24(this).trigger(%22click%22)%3B%7D)%7D)()

3 answers

1 vote
Brian Ewins
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 6, 2022

For anyone else like me stuck with these frustrating collapsed sections: the JS that works with the new markup is: document.querySelectorAll("[data-node-type='expand'][data-expanded='false']").forEach(e=>e.querySelector("button").click())

So the bookmarklet you want is (replace : with a real colon when you create the bookmark): 

javascript:(function()%7Bdocument.querySelectorAll(%22%5Bdata-node-type%3D'expand'%5D%5Bdata-expanded%3D'false'%5D%22).forEach(e%3D%3Ee.querySelector(%22button%22).click())%7D)()

 

0 votes
jdeklerk January 12, 2024

adding link for answered cross post:
How to create an "Expand All" button for Confluence

0 votes
Diego
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 10, 2020

Hello @Jacob Schwartz !

As I understand, you need to be able to expand all Expand Macros within your pages. What I can tell you is that this is not natively available for Confluence Cloud.

We have a standing Suggestion that tackles this very need. You can check the suggestion here:

I was also unable to find third-party addons that would provide such functionality.

I understand that this is not a final solution, but I believe it explains the current situation of this feature.

Jacob Schwartz
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 10, 2020

Thanks for the update here. I see that the last comment is in June, do you have any idea on when this is targeted to rollout?

Diego
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 11, 2020

Thanks for getting back to me @Jacob Schwartz !

Currently, I do not have a rollout schedule for this feature.

Suggest an answer

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

Atlassian Community Events