‘Expanding all’ in confluence

Tim Cameron
2 min readMar 26, 2018

--

At TransferWise we host our internal wiki in confluence. On nearly all pages we have headings that are collapsed using the ‘Expand’ macro, so they might look like this.

One problem that was often raised was that if you used Command+F (or Control+F on a PC) to search on a page, you weren’t able to search the info that’s hidden under the heading. We’d been hoping confluence will allow us to either expand all sections, or to have a search function that allows us to run a search that also looks in the hidden text. Personally, I have been following this Atlassian Jira ticket for a while now.

One of our developers (who used to be a PM at Atlassian) suggested a neat trick to create a bookmark which runs a javascript function that expands all the collapsed sections.

How to set it up

It will take about 2 minutes

Go to Chrome Settings >Bookmarks > Bookmark Manager > Add a new bookmark

Call the ‘Name’ whatever you want. I called mine ‘Expand’

In the URL, paste the code below:

javascript:(function()%7B%24(%22.expand-control%22).each(function()%7B%20%24(this).trigger(%22click%22)%3B%7D)%7D)()

And that’s it. Now when you click that button it will expand all the collapsed sections. Make sure it’s a shortcut on the bookmark bar to get the most out it.

--

--