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 to Look and Feel > Stylesheet:
#navigationbarpro{display: none !important;}
Since you can only configure SubSpace Navigation in the menu bar, you also need to 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.
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 the 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 that you configure and test the script on a test system before adding it to your production system.
Related Articles
- SubSpace and Linchpin Theme not working properly
- SubSpace and Metadata Integration
- Navigation Elements are displayed as No Permission
- Error when trying to add space element to navigation
- Cannot move child elements using drag and drop
- SubSpace Pricing Change
- How to force external links to open in a new tab
- Hide Navigation menu entry for specific groups
- Hide navigation in Confluence header
- CSS customization