How can I hide a nav bar for guest or normal users?
Last modified by Nikita Petrenko on 2025/06/22
For the global effect.
- First, ensure you are logged in to XWiki and have the necessary permissions to edit pages.
- Go to your profile page and enable an advanced user or use shortcut x+x+x+a, and enable displayed hidden pages or use shortcut x+x+x+h
- Open the Sandbox page or any page you want to edit.
- At the top right corner of the page, click on the "Edit" button and select "Object" or use shortcut "o"
- If this exists "Objects of type XWiki.StyleSheetExtension", then change the parameter "Use this extension" to On the demand only, and inside the field "Code" place the below-written code, otherwise create a new one.
#hierarchy { display: none }
Finally:
- Navigate to the DefaultSkin page via shortcut and type "Skin" into search field
- Select Default XWiki Skin
- Press "Edit this skin"
- Add the new overriding template, name it layoutExtraVars.vm and place these lines of code in the content block. If a template already exists, you can place that code at the beginning or end of the existing customization code.
#if(!$hasAdmin || $isGuest) #set ($discard = $xwiki.ssx.use('Sandbox.WebHome')) #end
Learn more about Skin extension.