Uploaded image for project: 'Confluence Cloud'
  1. Confluence Cloud
  2. CONFCLOUD-27077

Option to display expand macro expanded/collapsed on page load

    • 114
    • 16
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      NOTE: This suggestion is for Confluence Cloud. Using Confluence Server? See the corresponding suggestion.

      Status Update 3 Feb 2022

      👋 Hi - I’m a Divya Sriram, a PM on the Confluence team. I recognize that it's been a while since you've heard from the team, so I'm here with the update we owe you.

      Solving the option to display expand macro expanded/collapsed on page load is on our priority list. Currently, we are focused on critical work to improve table formatting and performance for Confluence Cloud pages - problems that are also affecting a very broad pool of users.

      We hope to start working on this soon and acknowledge that the delay on implementing this feature is frustrating for many of you. We will keep you updated on our progress.

      Thank you,

      Divya

      We should have an option to default expand macros to open/closed on page load. Text is not searchable from closed expand macros on page load.

      There is a large amount of feedback/comments on both of these pages relating to additional functionality surrounding this highly used macro.

      https://confluence.atlassian.com/display/DOC/Expand+Macro
      https://confluence.atlassian.com/display/DISC/Expand+Text+User+Macro

            [CONFCLOUD-27077] Option to display expand macro expanded/collapsed on page load

            jmarcyon added a comment -

            A simple "expand all on page" button seems like an easy fix for the problem where control+F doesn't find text inside a collapsed expand macro.

            jmarcyon added a comment - A simple "expand all on page" button seems like an easy fix for the problem where control+F doesn't find text inside a collapsed expand macro.

            There are ~29 related suggestions related to the Expand macro per this query, (~ "expand macro" AND project in ("Confluence Cloud", "Confluence Data Center") AND Issuetype in (Suggestion) AND status not in (closed)).

            Of that set, there is one with 966 votes that has graduated to "Under Consideration" status:  CONFCLOUD-78513: Nest Expand or other Bodied Macros in another Macro

            This one, CONFCLOUD-27077, only has 525 votes. 

            However, if it were combined with these, it could graduate to Under Consideration :

            • CONFCLOUD-54831: Expand macro expanded/collapsed default state, 208 votes
            • CONFSERVER-27077: Option to display expand macro expanded/collapsed on page load, 453 votes

            Christine Diamond added a comment - There are ~29 related suggestions related to the Expand macro per this query , (~ "expand macro" AND project in ("Confluence Cloud", "Confluence Data Center") AND Issuetype in (Suggestion) AND status not in (closed)). Of that set, there is one with 966 votes that has graduated to "Under Consideration" status:   CONFCLOUD-78513 : Nest Expand or other Bodied Macros in another Macro This one, CONF CLOUD -27077, only has 525 votes.  However, if it were combined with these, it could graduate to Under Consideration : CONFCLOUD-54831 : Expand macro expanded/collapsed default state, 208 votes CONF SERVER -27077: Option to display expand macro expanded/collapsed on page load, 453 votes

            It would be nice if collapsed sections were still searchable by the browser's "Find" function.

            Trent Boorman added a comment - It would be nice if collapsed sections were still searchable by the browser's "Find" function.

            Yannic De Baets added a comment - - edited

            Hi 5dd6d3cdd988 

            Is there any update on this requirement?

            Maybe the requirement should be (for cloud or non-cloud version):

            • be able to open and close all expand-sections on both open or edit status on each page => especially when having (workshop)calls with teams to align on further functionalities and all open questions per functionaltiy/requirment
            • also define the default-behaviour: open or closed on open-page or edit-page (seperately setting would be ideal)
            • ideal would be in any stage (open or edit page) => open or close all expand-sections with a shortcut (and button)

             

            Are there maybe other tickets related to this requirement that are indeed actively being working on (which we dont see related to this ticket)?

             

            Thank you for the update! (i hope this can be solved in 2024! : ) )

            Yannic De Baets added a comment - - edited Hi 5dd6d3cdd988   Is there any update on this requirement? Maybe the requirement should be (for cloud or non-cloud version): be able to open and close all expand-sections on both open or edit status on each page => especially when having (workshop)calls with teams to align on further functionalities and all open questions per functionaltiy/requirment also define the default-behaviour: open or closed on open-page or edit-page (seperately setting would be ideal) ideal would be in any stage (open or edit page) => open or close all expand-sections with a shortcut (and button)   Are there maybe other tickets related to this requirement that are indeed actively being working on (which we dont see related to this ticket)?   Thank you for the update! (i hope this can be solved in 2024! : ) )

            It's been nearly 2.5 years since the last status update which stated this feature was a priority. When can we expect this to be released?

            Xavier Amador added a comment - It's been nearly 2.5 years since the last status update which stated this feature was a priority. When can we expect this to be released?

            Mike Kosh added a comment -

            I was going to add a suggestion essentially requesting this same feature. The only thing I'll add is that I imagined this option as being a configuration to the macro itself in the same way that some other macros have additional configuration options. I think others have mentioned similar ideas. 

            Mike Kosh added a comment - I was going to add a suggestion essentially requesting this same feature. The only thing I'll add is that I imagined this option as being a configuration to the macro itself in the same way that some other macros have additional configuration options. I think others have mentioned similar ideas. 

            Looking forward to seeing this feature appear on Confluence Cloud soon. Ideally it would be an expand/close all toggle for the page. Can I also suggest that the macro is functional within the edit view too. The default behaviour of opening all of the collapsed elements in the edit view can be quite jarring, and being able to toggle them all closed, then select the element you wish to edit would be a much nicer workflow.

            David Kidger added a comment - Looking forward to seeing this feature appear on Confluence Cloud soon. Ideally it would be an expand/close all toggle for the page. Can I also suggest that the macro is functional within the edit view too. The default behaviour of opening all of the collapsed elements in the edit view can be quite jarring, and being able to toggle them all closed, then select the element you wish to edit would be a much nicer workflow.

            Sasha added a comment - - edited

            @alex medved, just create a new browser bookmark, rename it to whatever you need (calling mine "Expand"), and paste the code. Screenshot here https:// ibb.co/6Hf81Q6

            Sasha added a comment - - edited @alex medved, just create a new browser bookmark, rename it to whatever you need ( calling mine "Expand" ), and paste the code. Screenshot here https:// ibb.co/6Hf81Q6

            How can you do that on Confluence cloud? I mean, how and where can you use the javascript like that?

            Alex Medved {ConfiForms} added a comment - How can you do that on Confluence cloud ? I mean, how and where can you use the javascript like that?

            b90b63142108 

            I was able to make it work using this:

            javascript:(function(){document.querySelectorAll("[data-node-type='expand']").forEach(function(node)

            {node.querySelectorAll("button")[0].click();}

            )})()

            Raquel EZQUERRO BERMEJO added a comment - b90b63142108   I was able to make it work using this: javascript:(function(){document.querySelectorAll(" [data-node-type='expand'] ").forEach(function(node) {node.querySelectorAll("button")[0].click();} )})()

            RPT Admin: you're right, I'm using the new editor.

            Richard Uppheim added a comment - RPT Admin: you're right, I'm using the new editor.

            RPT Admin added a comment -

            Richard Uppheim - you're probably using the new editor? The javascript from Medium works for me on the legacy editor, but not on the new editor 

            RPT Admin added a comment - Richard Uppheim - you're probably using the new editor? The javascript from Medium works for me on the legacy editor, but not on the new editor 

            Hmm...followed the suggestion on Medium and tried the various javascript URLs suggested in the comments. However, in my Confluence cloud it doesn't seem to expand/collapse sections.

            Richard Uppheim added a comment - Hmm...followed the suggestion on Medium and tried the various javascript URLs suggested in the comments. However, in my Confluence cloud it doesn't seem to expand/collapse sections.

            Sasha added a comment - - edited

            @glenn Truly amazing, thanks a lot ! I'm not familiar with Javascript so was unable to update it myself. You're correct about the "subject to change" : The code on Medium not only expands the expand sections in the page's body, but also the left navigation bar, and the right help bar ! Is that the same result on your side as well ?

            Your own code is neat and completely functional as of today, only expands the page's body sections, as expected : 

             

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

             

            Sasha added a comment - - edited @glenn Truly amazing, thanks a lot ! I'm not familiar with Javascript so was unable to update it myself. You're correct about the "subject to change" : The code on Medium not only expands the expand sections in the page's body, but also the left navigation bar, and the right help bar ! Is that the same result on your side as well ? Your own code is neat and completely functional as of today, only expands the page's body sections, as expected :    javascript:(function(){document.querySelectorAll( "[data-node-type= 'expand' ]" ).forEach(function(node){node.querySelectorAll( "button" )[0].click();})})()  

            Glenn Morrow added a comment - - edited

            @sasha

            I wasted too much time on this - lol - but updated to match current Confluence Cloud (subject to Atlassian changing things again at any time)

            javascript:(function() {document.querySelectorAll("[data-node-type='expand']").forEach(function(node) 

            { node.querySelectorAll("button")[0].click();}

             )})()

             

            Only to see in the comments of https://medium.com/@timcameron/expanding-all-in-confluence-db0d3cd711f0 someone already gave a modified version. Lol

             

            Glenn Morrow added a comment - - edited @sasha I wasted too much time on this - lol - but updated to match current Confluence Cloud (subject to Atlassian changing things again at any time) javascript:(function() {document.querySelectorAll(" [data-node-type='expand'] ").forEach(function(node)  { node.querySelectorAll("button")[0].click();}  )})()   Only to see in the comments of https://medium.com/@timcameron/expanding-all-in-confluence-db0d3cd711f0 someone already gave a modified version. Lol  

            Sasha added a comment -

            Hello there, quick poke to ask a question:

            https://community.atlassian.com/t5/Confluence-questions/Expand-macro-How-to-Expand-all-on-Confluence-page/qaq-p/2150104
            https://medium.com/@timcameron/expanding-all-in-confluence-db0d3cd711f0

            Previous solution bought here doesn't work anymore. I used to work with this when I was working for Wise (formerly Transferwise), but on my current ConfCloud instance it's broken.

            Any idea how this could be repaired ? 
            {{}}

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

            Kind regards !

            Sasha added a comment - Hello there, quick poke to ask a question: https://community.atlassian.com/t5/Confluence-questions/Expand-macro-How-to-Expand-all-on-Confluence-page/qaq-p/2150104 https://medium.com/@timcameron/expanding-all-in-confluence-db0d3cd711f0 Previous solution bought here doesn't work anymore. I used to work with this when I was working for Wise (formerly Transferwise), but on my current ConfCloud instance it's broken. Any idea how this could be repaired ?  {{}} javascript:(function()%7B%24(%22.expand-control%22).each(function()%7B%20%24( this ).trigger(%22click%22)%3B%7D)%7D)()  Kind regards !

            Jo Vane added a comment -

            any updates on when will this become a feature?

            Jo Vane added a comment - any updates on when will this become a feature?

            1

            We very badly want this.

            Steven Martin added a comment - We very badly want this.

            At the very least, when searching a page for text, all the Expand items where the text is found should auto-expand. As such Confluence would require a text search option with the context set to the page being searched. Since it is highly unlikely Atlassian will ever address this, we will settle for some way to expand all text. Anyway, hopefully Confluence will do with way of browsers, one day someone will appear on the scene with a new wiki and overnight Confluence will be gone. Good night Atlassian.

            Lionel Bartlett added a comment - At the very least, when searching a page for text, all the Expand items where the text is found should auto-expand. As such Confluence would require a text search option with the context set to the page being searched. Since it is highly unlikely Atlassian will ever address this, we will settle for some way to expand all text. Anyway, hopefully Confluence will do with way of browsers, one day someone will appear on the scene with a new wiki and overnight Confluence will be gone. Good night Atlassian.

            looking forward to this

            Khumbo MPIKAMEZO added a comment - looking forward to this

            Please make this feature a priority! It would be very useful

            Aaron Brennan added a comment - Please make this feature a priority! It would be very useful

            Please please please!

            Craig Hawes added a comment - Please please please!

            henry added a comment -

            still need this please

            henry added a comment - still need this please

            Hello! Are you working on this issue? It will be very useful to have it in place. thanks!

            Raquel EZQUERRO BERMEJO added a comment - Hello! Are you working on this issue? It will be very useful to have it in place. thanks!

            +1

            Any update on this development?

            Bhaskoro Muthohar added a comment - Any update on this development?

            This would be very useful as currently is there is content behind a collapsed window its hidden from page search results (ctrl + f) so it would be very helpful to be able to expand all sections to allow on-page search to work. 

            Johnny O'Neill added a comment - This would be very useful as currently is there is content behind a collapsed window its hidden from page search results (ctrl + f) so it would be very helpful to be able to expand all sections to allow on-page search to work. 

            Hi guys, please implement this feature as using the Table of Contents is useless when dealing with large pages with many expands in it. Even if we need to set each one manually, I'd take that over it doing absolutely nothing. 

            Anthony Hall added a comment - Hi guys, please implement this feature as using the Table of Contents is useless when dealing with large pages with many expands in it. Even if we need to set each one manually, I'd take that over it doing absolutely nothing. 

            I want it........

            Johan Ekman added a comment - I want it........

            we had a workaround on server and are really missing this functionality in cloud

            Richard Baar added a comment - we had a workaround on server and are really missing this functionality in cloud

            The code on the pages has changed since this bug was opened many years ago so the bookmarklet workaround needs updated. This works for me in confluence cloud (replace : with : ), hope this helps anyone else stumbling in here.

            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)()

            Brian Ewins added a comment - The code on the pages has changed since this bug was opened many years ago so the bookmarklet workaround needs updated. This works for me in confluence cloud (replace : with : ), hope this helps anyone else stumbling in here. 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)()

            upvote

            yongji.zhou added a comment - upvote

            Upvote. As part of this, I'd like to see the option to expand/collapse all expand on a page at once. Example: I want them all collapsed by default so I only see high-level information if that's all I need when visiting the page. However, if I need to dive further into the details, I'd want to expand all of them at once. This would/should open up the searching ability as others have said.

            Dave Younker added a comment - Upvote. As part of this, I'd like to see the option to expand/collapse all expand on a page at once. Example: I want them all collapsed by default so I only see high-level information if that's all I need when visiting the page. However, if I need to dive further into the details, I'd want to expand all of them at once. This would/should open up the searching ability as others have said.

            Ditto what others said. The in ability to search collapsed content is the primary issue. The ability to just expand all/show all/collapse all would also be useful.

            Additional config options:

            • Heading styles: I would love to option to associate heading styles (h1, h2, h3) with the expand macro title. This would enable the option to include expand/collapse titles in an index or toc. It would also support the ability to link to a specific expand item as you might a heading. 
            • Formatting: ability to format the expand item, similar to what you can do with the panel macro would be useful. 

            Christine Diamond added a comment - Ditto what others said. The in ability to search collapsed content is the primary issue. The ability to just expand all/show all/collapse all would also be useful. Additional config options: Heading styles: I would love to option to associate heading styles (h1, h2, h3) with the expand macro title. This would enable the option to include expand/collapse titles in an index or toc. It would also support the ability to link to a specific expand item as you might a heading.  Formatting: ability to format the expand item, similar to what you can do with the panel macro would be useful. 

            Also adding interest for the expand all option. We're also impacted by the inability to search collapsed content. 

            cinco.coates added a comment - Also adding interest for the expand all option. We're also impacted by the inability to search collapsed content. 

            David Su added a comment -

            Being able to expand pages nested under other pages in one go without clicking through them is important for us

            David Su added a comment - Being able to expand pages nested under other pages in one go without clicking through them is important for us

            Not being able to search within all content (whether expanded or not) is a major drawback for my colleagues and I, and if it isn't fixed soon, we may need to find another platform.

            marybeth.stramaglia added a comment - Not being able to search within all content (whether expanded or not) is a major drawback for my colleagues and I, and if it isn't fixed soon, we may need to find another platform.

            ...via advanced search or just via the web-page search  - therefore the need for a simple expand/collapse, so we dont need to manually expand all sections on the page. 

            Alette N. L. Olrik added a comment - ...via advanced search or just via the web-page search  - therefore the need for a simple expand/collapse, so we dont need to manually expand all sections on the page. 

            Ability to search within collapsed content via advanced search is a key requirement for us to continue using this feature.

            Sally Whitehead added a comment - Ability to search within collapsed content via advanced search is a key requirement for us to continue using this feature.

            Celine Penaredondo added a comment - - edited

            +1

            If I can vote 500 times, I will. 

            Celine Penaredondo added a comment - - edited +1 If I can vote 500 times, I will. 

            Larry Ross added a comment -

            No solution for adding to a page for everyone to use.  But for personal use - I have a bookmark with the following URL:

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

            When I am on a page I want everything expanded on - I select the bookmark. Select again to collapse all.

            Larry Ross added a comment - No solution for adding to a page for everyone to use.  But for personal use - I have a bookmark with the following URL: javascript:(function()%7B%24(%22.expand-control%22).each(function()%7B%20%24( this ).trigger(%22click%22)%3B%7D)%7D)() When I am on a page I want everything expanded on - I select the bookmark. Select again to collapse all.

            Is anyone using a workaround for this that actually works? All of the ones I've found in forums do not. Thank you! 

            Michael Negron added a comment - Is anyone using a workaround for this that actually works? All of the ones I've found in forums do not. Thank you! 

            Thank you for the update Divya! Looking forward to the release of this feature. 

            Eddie Jauregui added a comment - Thank you for the update Divya! Looking forward to the release of this feature. 

            A. Krei added a comment -

            We also would need to link from the ToC into a collapsed expand macro. The legacy requirement would be, to keep the expand macro collapsed but links from ToC and somewhere else should be working.

            Additionally to searching in a collapsed area would be useful.

            A. Krei added a comment - We also would need to link from the ToC into a collapsed expand macro. The legacy requirement would be, to keep the expand macro collapsed but links from ToC and somewhere else should be working. Additionally to searching in a collapsed area would be useful.

            tabithar added a comment -

            I had to come here to figure out why my ToC couldn't link my headings inside of an Expand macro, when they were showing up in the ToC. This should be basic functionality.

            tabithar added a comment - I had to come here to figure out why my ToC couldn't link my headings inside of an Expand macro, when they were showing up in the ToC. This should be basic functionality.

            Paul Streng solution may work well, but it requires the HTML macro from the market place; no good for us - I'm unable to add marketplace add-on's to our site.  Would prefer a "Confluence" solution

            Michelle Smith added a comment - Paul Streng solution may work well, but it requires the HTML macro from the market place; no good for us - I'm unable to add marketplace add-on's to our site.  Would prefer a "Confluence" solution

            I found this and works nicely.

            <a id="toggleAll" href="#">Expand/Collapse All FAQs</a> <script type="text/javascript"> AJS.toInit(function () { AJS.$('#toggleAll').click(function() { jQuery(".expand-control").each(function()

            { jQuery(this).trigger("click");}

            ) }); }); </script>

            Just add to an HTML macro at top of each page.

             

            Paul Streng added a comment - I found this and works nicely. <a id="toggleAll" href="#">Expand/Collapse All FAQs</a> <script type="text/javascript"> AJS.toInit(function () { AJS.$('#toggleAll').click(function() { jQuery(".expand-control").each(function() { jQuery(this).trigger("click");} ) }); }); </script> Just add to an HTML macro at top of each page.  

            +1

            +1

            +1

            +1

            +1

            +1

            Will Peterson added a comment - +1 +1 +1 +1 +1 +1

            Definitely needed.  

            Paul Streng added a comment - Definitely needed.  

            +1 Recently upgraded from Server to Cloud and this is a real PITA for us.

            Christa Meck added a comment - +1 Recently upgraded from Server to Cloud and this is a real PITA for us.

            +1

            +1 - showstopper issue for us

            Tim Harville added a comment - +1 - showstopper issue for us

            +1 This is very much needed.

            shaun.titus added a comment - +1 This is very much needed.

            noticed that the internal confluence page has the expand sections collapsed as default, but same page on the service desk (customer facing portal) has the sections expanded by default... configuration per expand block would be great. i didn't see the refined UI Expand macro available for confluence cloud.

             

            Simon Evans added a comment - noticed that the internal confluence page has the expand sections collapsed as default, but same page on the service desk (customer facing portal) has the sections expanded by default... configuration per expand block would be great. i didn't see the refined UI Expand macro available for confluence cloud.  

            Adam Sassatelli added a comment - - edited

            +1. This is a huge request for our teams. And without the ability to search non expanded content, it is a real blocker in their workflow! Is there any update on this, as it looks like it has been a suggestion for a few years with no movement. 

            Thanks! 

            Adam Sassatelli added a comment - - edited +1. This is a huge request for our teams. And without the ability to search non expanded content, it is a real blocker in their workflow! Is there any update on this, as it looks like it has been a suggestion for a few years with no movement.  Thanks! 

              Unassigned Unassigned
              rgoodwin Ryan Goodwin (Inactive)
              Votes:
              538 Vote for this issue
              Watchers:
              253 Start watching this issue

                Created:
                Updated: