XF 2.2 Removing the "log in" button

DimitriT

New member
Is there a way to remove the log in button? We're customizing our forum to use SSO and it will have a custom log in button. Once removed, if the SSO doesn't work, I can have the admins go to the https://[domain]/forum/index.php?login/ address.

Thank you!
 
I'd like to add a bit of complexity into this. I've hired a developer to create a single-sign-on addon (to use our member software's database for login) . The deveoper did what we asked and now we have a button next to the default "Log in" one which technically will do it's magic through the add-on and when a member tries to login, it will go and look to the membership platform database. What I was hoping to do is to remove the default"Log in" button (with the p-navgroup-link--login option, above) but somehow maintain the customer "SSO Login" one.

1611784924536.webp
Sorry, having too much fun with Photoshop ;)

Is that even possible? Is this an add-on customization and I need to check with the developer? Or is it something I can control within XF?

Thanks!
 
This added to the extra.less template will hide it:

Less:
.p-navgroup-link--logIn
{
    display: none;
}

However, that won't prevent anyone manually navigating to /login.

You will likely want to edit the log in template or create a route filter/redirect to force it to the custom log in URL.
 
This added to the extra.less template will hide it:

Less:
.p-navgroup-link--logIn
{
    display: none;
}

However, that won't prevent anyone manually navigating to /login.

You will likely want to edit the log in template or create a route filter/redirect to force it to the custom log in URL.

Unfortunately, this removes both the default and the custom buttons...
 
Tell your developer to use a custom class for the log in button to prevent conflicts with core components.

Failing that, edit the PAGE_CONTAINER template and remove the code.
HTML:
<a href="{{ link('login') }}" class="p-navgroup-link p-navgroup-link--textual p-navgroup-link--logIn"
   data-xf-click="overlay" data-follow-redirects="on">
    <span class="p-navgroup-linkText">{{ phrase('log_in') }}</span>
</a>

Or better still, get the developer to do a template replace on that code with your custom URL.
 
Top Bottom