/
Hide navigation in Confluence header

Hide navigation in Confluence header

Because we have already a main navigation within our custom theme, we want to hide the navigation bar in the Confluence header. How do we configure this without losing our space hierarchy?

Solution

To hide the navigation globally, you can add the following CSS code into Look and Feel > Stylesheet:

#navigationbarpro{display: none !important;}

As you can only configure the SubSpace Navigation in the menu bar, you need to additionally create a new user macro and choose "No macro body". Add the following code as a template:

## @noparams <a class="openadminnavilink" href="#">Open SubSpace-Admin</a> <script> jQuery(function(){ jQuery(".openadminnavilink").click(function(){ jQuery("#administratenavigation").click(); }); }); </script>

When adding this macro to a Confluence page you will see the configuration screen.

We have logged the following requirements for further development: CSSP-328: Option to hide the SubSpace menu entirelyOpen.

Hide navigation bar for logged-out users

To hide the navigation bar for logged-out users, you can add the following script code into: Confluence administration > Look and Feel > Custom HTML > Insert Custom HTML at end of the HEAD:

<script> document.addEventListener("DOMContentLoaded", function () { if(AJS.Meta.get("remote-user") == "") { document.getElementById("navigationbarpro").style.display = "none"; } });</script>

We strongly recommend you configure and test the script in a test system first, before adding it to your productive system.

Related Articles





Related content

Restrict number of spaces shown in global navigation
Restrict number of spaces shown in global navigation
Read with this
Create new child sub-spaces under space elements
Create new child sub-spaces under space elements
Read with this
Automatically set SubSpace Navigation spaces
Automatically set SubSpace Navigation spaces
Read with this
Navigation color is wrong after update to version 3.3
Navigation color is wrong after update to version 3.3
Read with this
Replace Subspace Macro with Navigation Macro
Replace Subspace Macro with Navigation Macro
Read with this
Spaces are reset after migration from 2.2.2 to 3.x
Spaces are reset after migration from 2.2.2 to 3.x
Read with this