Hiding sidebar and menu-bar at top (need help !)

Marcel Plomp (inactive) October 18, 2017

We want to incorporate a space with application information into our operational software. The goal is that users can see this information without the need to log in to Confluence and without the left hand sidebar and menu-bar at the top.

For this my colleague has created a script that we added to the Main layout decorator for the space. We inserted this at the end of HEAD.  The script is as follows:

<script>
  AJS.toInit(function(){
    //If the sidebar is visible, hide it and the split bar...
    if (AJS.params.remoteUser == '' && AJS.$("div.ia-fixed-sidebar").width() > 0 ) {
      // hide the sidebar area (including space tools)
      AJS.$("div.ia-fixed-sidebar").hide();
      // ...then change the width and position of the content
      AJS.$('div.aui-page-panel').css({'width':'100%', 'left':'0', 'margin-left':'0'});
    };
  });
</script>

The script works fine but only partly. We achieved that the sidebar is removed. The menu bar is also gone. We also managed to hide the footer (this is in another part of the decorator). We still see the bread crumbs and the page title.

The problem is that when we scroll down on a larger page, the content moves over the bread crumbs. The bread crumbs themselves also move up but only a little bit. When we scroll up again we don't see the title anymore.
Refreshing the page bring us back to were we started (obviously)

In addition to that, we still are missing is the following.

  • center the page
  • limit the width to 960px

When we add code for this, we create some other problems. Somehow the breadcrumbs move to the right hand site instead of staying on the left hand site.

Does anyone have a solution? 

We use Confluence 6.0.

 

 

 

 

1 answer

0 votes
Brant Schroeder
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 18, 2017

I think you should just use CSS.  You could identify the regions you would like to hide and use display:none property.  Center the information and setting a maximum width could also be controlled with CSS.

Marcel Plomp (inactive) October 26, 2017

I actually was hoping if somebody has a code available.....

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events