How to hide the Login button?
Last modified by Vincent Massol on 2024/12/24
XWiki 16.10.0+
XWiki has a login button on the top navigation bar, that you may want to hide (for example if you want to show a non-loggable website to your users).
The register button can easily be removed by removing the guest user permission to Register.
The Log-in button needs a more specific action:
- Log in as an admin of your wiki
- Access the hidden Registration page (Show hidden pages if needed).
- Edit the objects of the Registration page (Set advanced mode to edit to have the UI button to edit page objects).
- Update the content of the XWiki.UIExtensionClass xobject you can find on the Registration page. Remove lines 11 to 15, containing the template for the button:#if ($xcontext.user == 'XWiki.XWikiGuest' && !$xcontext.inactiveUserReference)
<li>
<a href="$xwiki.getURL('XWiki.XWikiLogin', 'login', "xredirect=$redirectURL&loginLink=1")" id="tmLogin" rel="nofollow">$escapetool.xml($services.localization.render('login'))</a>
</li>
#end - Save your changes.
From then on, the login button in the navbar will not be shown anymore on your wiki.