Modify Login Form Topic is solved

General questions relating to Joomla! 4.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Post Reply
kkurtz
Joomla! Intern
Joomla! Intern
Posts: 55
Joined: Thu Jul 12, 2012 1:38 pm

Modify Login Form

Post by kkurtz » Fri Dec 08, 2023 11:16 pm

First, I want to remove the remember me, forgot password, forgot username, and Web Authentication items on the login form. I have tried using the mod-login override and commenting out the appropriate code. Doesn't seem to work.

Second, I want the form to appear in the footer. I have made a position for it in the footer, but it seems to default to the main position.

My site is J4clean.californiadar.org.

nacc
I've been banned!
Posts: 347
Joined: Mon Jul 03, 2023 7:08 pm

Re: Modify Login Form

Post by nacc » Fri Dec 08, 2023 11:47 pm

1) To remove the "web authentication" item from the login forum, disable the plugin System - WebAuthn Passwordless Login

2) To remove the remember me checkbox, disable the plugin System - Remember Me

3) To remove the forgot password and forgot username links, disable user registration.

4) To place the login form in the footer, assign the module to the module position named "footer".

kkurtz
Joomla! Intern
Joomla! Intern
Posts: 55
Joined: Thu Jul 12, 2012 1:38 pm

Re: Modify Login Form

Post by kkurtz » Sat Dec 09, 2023 8:02 pm

Items 1 and 2 in your reply worked.

For items 3 and 4: This is hard to explain...When I started working on this J4 template I was able to create a login form that looked they way I wanted it to. No remember me, forgot psw, or forgot username. And It was places where I wanted it - in the footer. Then when I was working on another template for the same site I must have done something to cause the menu and login form to disappear. Now the original is back and I can't get rid of the login form that keeps appearing in the main position. I have trashed the module it was assigned to but it won't go away.
I should also mention that removing the user registration did not remove the "forgot" links. The only thing that works for that is to comment out the pertinent code in the mod-login override.

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 43880
Joined: Sat Apr 05, 2008 9:58 pm

Re: Modify Login Form

Post by Webdongle » Sat Dec 09, 2023 9:28 pm

Create mod login override
in /templates/yourtemplatehtml/mod_login/default.php delete or comment out

Code: Select all

               <a class="com-users-login__reset list-group-item" href="<?php echo Route::_('index.php?option=com_users&view=reset'); ?>">
            <?php echo Text::_('COM_USERS_LOGIN_RESET'); ?>
        </a>
        <a class="com-users-login__remind list-group-item" href="<?php echo Route::_('index.php?option=com_users&view=remind'); ?>">
            <?php echo Text::_('COM_USERS_LOGIN_REMIND'); ?>
        </a>
In /templates/yourtemplatehtml/html/com_users/login/default_login.php delete or comment out

Code: Select all

<a class="com-users-login__reset list-group-item" href="<?php echo Route::_('index.php?option=com_users&view=reset'); ?>">
            <?php echo Text::_('COM_USERS_LOGIN_RESET'); ?>
        </a>
        <a class="com-users-login__remind list-group-item" href="<?php echo Route::_('index.php?option=com_users&view=remind'); ?>">
            </a><?php echo Text::_('COM_USERS_LOGIN_REMIND'); ?>
            
If a login form keeps showing when you have disabled Joomla login modules could it be a custom Template doing it?
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

nacc
I've been banned!
Posts: 347
Joined: Mon Jul 03, 2023 7:08 pm

Re: Modify Login Form

Post by nacc » Sat Dec 09, 2023 9:58 pm

That's not the answer, @Webdongle. The OP uses Cassiopeia. There's no need (unless it's out of desperation) to create overrides just to remove the forgot password/username links when, in fact, these links are removed (from the login module) simply by disabling the user registration.

The OP has overlooked the fact that there are several places where users can login to this website: there's a menu item at the top of the page; there's a menu item on the footer of the page. These menu items redirect to other pages display the login form. One of these pages also displays the login module. The OP needs to understand the difference between the login form and the login module.

From what I can see, the login module is working as it's supposed to be working without the forgot password/username links, the remember me checkbox and the passwordless login feature. The login form, on the other hand, on the two pages I've mentioned, does not work in the way it should. I don't know the reason for that.

If there's a need to "override" things, then two overrides are necessary. I don't believe there's a need here to override those things when everything that's needed is contained within the Joomla core ... however ... it depends on the question: are we discussing the login module (which can be assigned to any module position and any menu item) or are we discussing the login form [view] that always appears in the "main" section?

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 43880
Joined: Sat Apr 05, 2008 9:58 pm

Re: Modify Login Form

Post by Webdongle » Sat Dec 09, 2023 11:05 pm

nacc wrote:
Sat Dec 09, 2023 9:58 pm
That's not the answer, @Webdongle. The OP uses Cassiopeia. There's no need (unless it's out of desperation) to create overrides just to remove the forgot password/username links when, in fact, these links are removed (from the login module) simply by disabling the user registration....
The OP asked to remove the forgot password/username links not the registration link. Besides which the Registration link is set in User Options not the login module. Also not allowing Registration has no affect on the forgot password/username links. As you are are a relatively new user I would suggest you check your incorrect assumptions before your uninformed posts confuse other users.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

kkurtz
Joomla! Intern
Joomla! Intern
Posts: 55
Joined: Thu Jul 12, 2012 1:38 pm

Re: Modify Login Form

Post by kkurtz » Sun Dec 10, 2023 2:28 pm

I thought I had sent a reply to Webdongle's first post reply. But I guess I didn't. I had used the mod-login/default.php from from the Modules list on the Create Overrides page. The correct one in from com-users/tmpl/login/default-login.php. I commented out the pertinant code and it worked.

Regarding nacc's reply...the Member Login at the top of the page goes to a totally different site. Ignore that for now. It is the one at the bottom of the page that is the issue. The forgot password/username links, the remember me checkbox were removed by using the override I mention above. I tried to remove them by removing user registration, but that didn't work.

Again regarding nacc's reply...you say "are we discussing the login module (which can be assigned to any module position and any menu item) or are we discussing the login form [view] that always appears in the "main" section?" The login module is assigned to the footer position. If you click on the Webmaster Login link at the bottom of the page you will see two login forms - one in the footer and one in main. The one in the footer is the one I want. But I hve no idea why there are two. You say the login form [view] always appears in main. Then why bother assigning the login module anywhere else?

The regarding Webdongles reply to nacc's post...you say "the Registration link is set in User Options not the login module" The registraton option has always been set to no. And you are right it didn't cause the removal of the forgot password/username links, the remember me checkbox.

Bottom line...I want the login form at the bottom of the page, in the footer, to remain and I want the one in main removed. How can I make that happen?

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 43880
Joined: Sat Apr 05, 2008 9:58 pm

Re: Modify Login Form

Post by Webdongle » Sun Dec 10, 2023 4:24 pm

What do you mean "the one in main removed"? Main what?
kkurtz wrote:
Sun Dec 10, 2023 2:28 pm
...

Bottom line...I want the login form at the bottom of the page, in the footer, to remain and I want the one in main removed. How can I make that happen?

kkurtz wrote:
Sun Dec 10, 2023 2:28 pm
...
Regarding nacc's reply.... The forgot password/username links, the remember me checkbox were removed by using the override I mention above. I tried to remove them by removing user registration, but that didn't work. ...
Methinks you will need to forgive nacc as you can see they are a relatively new member to the forum. As such they are apparently making loads of mistakes in their posts.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

kkurtz
Joomla! Intern
Joomla! Intern
Posts: 55
Joined: Thu Jul 12, 2012 1:38 pm

Re: Modify Login Form

Post by kkurtz » Sun Dec 10, 2023 7:20 pm

"Main" is where the article content goes. It isn't a position that shows up when you are trying to assign a position to a module. But if you do an inspect of the page you will see that the form is placed in .container-component main. Likewise if you inspect the home page the article is placed there.

I will forgive nacc, but I will take his advice with a grain of salt.

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 43880
Joined: Sat Apr 05, 2008 9:58 pm

Re: Modify Login Form

Post by Webdongle » Sun Dec 10, 2023 8:09 pm

The login form has an id login-form-135 (the same as the one at the bottom)

Conclusions
1. The page it shows on has a menu item Title Alias 'new-webmaster-login'. If the Title Alias was auto generated the menu Title will be the same but with some upper case letters and no hyphens.
2. The page it shows on has a loadposition, loadmodule or similar with modules anywhere.

Sugestion
You change the 'Webmaster login' link to /administrator to show the Joomla standard login. and delete the new-webmaster-login page and menu item
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

kkurtz
Joomla! Intern
Joomla! Intern
Posts: 55
Joined: Thu Jul 12, 2012 1:38 pm

Re: Modify Login Form

Post by kkurtz » Wed Dec 13, 2023 4:15 pm

You say the top login form has an id login-form-135. However I don't see that at all. Here is what I see:
<main>
<div class="com-users-login login">
<form action="/index.php/new-webmaster-login?task=user.login" method="post" class="com-users-login__form form-validate form-horizontal well" id="com-users-login__form">
<fieldset>
<div class="control-group com-users-login__input">
<div class="control-label"><label id="username-lbl" for="username" class="required">
Username<span class="star" aria-hidden="true">&#160;*</span></label>
</div>
<div class="controls">
<input
type="text"
name="username"
id="username"
value=""
class="form-control validate-username required" size="25" required autocomplete="username" autofocus >
</div>
</div>
<div class="control-group com-users-login__input">
<div class="control-label"><label id="password-lbl" for="password" class="required">
Password<span class="star" aria-hidden="true">&#160;*</span></label>
</div>
<div class="controls">
<div class="password-group">
<div class="input-group">
<input
type="password"
name="password"
id="password"
value=""
autocomplete="current-password" class="form-control required" size="25" maxlength="99" required data-min-length="12" >
<button type="button" class="btn btn-secondary input-password-toggle">
<span class="icon-eye icon-fw" aria-hidden="true"></span>
<span class="visually-hidden">Show Password</span>
</button>
</div>
</div> </div>
</div>
<div class="com-users-login__submit control-group">
<div class="controls">
<button type="submit" class="btn btn-primary">
Log in </button>
</div>
</div>
<input type="hidden" name="return" value="MTAx">
<input type="hidden" name="06d479453f4da2a888ef8309c924af66" value="1"> </fieldset>
</form>
<!--<div class="com-users-login__options list-group">
<a class="com-users-login__reset list-group-item" href="/index.php/new-webmaster-login?view=reset">
Forgot your password? </a>
<a class="com-users-login__remind list-group-item" href="/index.php/new-webmaster-login?view=remind">
Forgot your username? </a>
</div>-->
</div>
</main>
I do see the id="login-form-135" for te bottom form.

Regarding the conclusions...
Conclusions
1. The page it shows on has a menu item Title Alias 'new-webmaster-login'. If the Title Alias was auto generated the menu Title will be the same but with some upper case letters and no hyphens.
The alias was auto generated and it has hyphens and no upper case letters
2. The page it shows on has a loadposition, loadmodule or similar with modules anywhere.
Not sure what you are trying to tell me here.

Regarding your suggestion:
Sugestion
You change the 'Webmaster login' link to /administrator to show the Joomla standard login. and delete the new-webmaster-login page and menu item.
How do I "change the 'Webmaster login' link to /administrator"

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 43880
Joined: Sat Apr 05, 2008 9:58 pm

Re: Modify Login Form

Post by Webdongle » Wed Dec 13, 2023 5:00 pm

My bad, I must have scrolled down too far. In that case the form is generated from a menu item type Login. And a Template override changing it from the standard?

/new-webmaster-login is a clue that there is a menu item for that page

<div class="com-users-login login"> is a clue that the menu item points to the login component.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

kkurtz
Joomla! Intern
Joomla! Intern
Posts: 55
Joined: Thu Jul 12, 2012 1:38 pm

Re: Modify Login Form

Post by kkurtz » Wed Dec 13, 2023 5:44 pm

Why do I have 2 login forms?

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 43880
Joined: Sat Apr 05, 2008 9:58 pm

Re: Modify Login Form

Post by Webdongle » Wed Dec 13, 2023 8:07 pm

Best guess One is a module that is assigned to a menu item and displays when the menu item is clicked.

The other is a component that is showing on the page that the menu item (type login) is linked to
You don't see the menu item because it is hidden.

But the hyperlink at the bottom of the page links to the hidden menu item /new-webmaster-login
That is not the admin login afaik

Change the link in the footer to /administrator
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

kkurtz
Joomla! Intern
Joomla! Intern
Posts: 55
Joined: Thu Jul 12, 2012 1:38 pm

Re: Modify Login Form

Post by kkurtz » Sat Dec 16, 2023 9:09 pm

I finally figured out how to fix this.
I pointed the Webmaster Login menu item at the bottom of the page to an article, which has no content.
Then the login module contains the form in the footer position.


Post Reply

Return to “General Questions/New to Joomla! 4.x”