Can disable/deactivate/turn-off the sidebar with CSS - but can't re-enable.

I'm iFraming a confluence landing page in a mashery portal. The mashery page isn't full screen so I want to turn off the side bar - just for the landing page, then re-enable as soon as the visitor goes to another page in confuence.

The disable works, but wierdly not the re-enable. It shouldn't even carry on to the second page, but it does and even when I try to turn it on, it won't. Any ideas?

Here is how I disable using a HTML macro on the page.

<style type="text/css">
.breadcrumb-section {display: none !important;}
#splitter-sidebar  {display: none !important;}

Then, on the subsequent page, I do the opposite and re-enable those elements (this doesn't work - side bar still disabled)

<style type="text/css">
.breadcrumb-section {display: inline !important;}
#splitter-sidebar  {display: inline  !important;}

Any ideas or have a bit of JavaScript that will re-enable it?

1 answer

Genius beside me solved it.

When the sidebar is disabled, a cookie is written to storage, which persists across pages.

To re-enable the side-bar then, just remove the cookie as the page unloads:

<script type="text/javascript">
var wunload = window.onunload;

window.onunload= function(e) {
    document.cookie = 'doc-sidebar=; expires=' + (new Date(0)).toUTCString() + '; path=/;';

    if (wunload !== undefined && typeof wunload === 'function') {

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Confluence

Three common content challenges + how to manage them

An efficient enterprise content management system, or ECM, is a must-have for companies that create work online (cough   cough, all companies). If content calendars, marketing plans, and bu...

98 views 0 6
Read article

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