Can I make a button to show/hide the sidebar?

Some users don't know about the menu button for hiding the sidebar, so on a specific page I'd like to make a normal HTML button that when clicked toggles the sidebar. Then I can put it in a panel.

2 answers

1 accepted

0 votes
Accepted answer
Davin Studer Community Champion Jul 25, 2014

You can certainly do that. All you need to do it edit the page template and put a button somewhere on the page that will fire off some javascript to programatically click the one in your header. Now, from a usability standpoint I think it is a better idea just to educate the users rather than duplicate functionality on the page.

Davin Studer Community Champion Jul 25, 2014

Didn't realize that you want it only an a specific page. Same answer just without editing the template. I would create a user macro to do this. It would look something like this.

## @noparams
<form class="aui">
    <button id="custom-splitter-toggle" class="aui-button">Toggle Sidebar</button>
<script type="text/javascript">

0 votes

There's a button on the sidebar to toggle it, next to "space tools". The << and >>

That's in the standard theme though - if you're using a different version of Confluence and/or a different theme, it might not be there, but it might be possible to add it. But we'd need to know what we're working with.

I'm using the Documentation theme, and there is a button right next to search that does what I want, but since it is unlabled people miss it. I'd like to add a second more obvious button in the page text itself.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Feb 06, 2019 in Confluence

Try out the new editing experience

Hi team, I’m Avinoam, a product manager on Confluence Cloud, and today I’m really excited to let the Community know that all customers can now try out the new editing experience and see some of the ...

793 views 33 5
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you