Hi,
Where is code for login form?
How ovveride it only for presentation/view side?
Thank you
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
Hi,
Where is code for login form?
How ovveride it only for presentation/view side?
Thank you
The easiest way if you just want a custom page for it is to make a template called Security_login in your Layout folder. Security is the name of the controller that handles all the login stuff and login is the action name so that will at least give you your own template for it. The problem with modifying the login form is that it gets returned as a string to the template (I think) and not as a normal form so you can't use <% control %> to walk through it and create your own layout.
What you can do is to simply make your own login form and put it in the template file and layout that in whatever way you want, not sure if you lose out on some functionality though.
Thank's for your reply. So, I'll try Login group redirection form, or have you a login code example?
Anyone had any success on this? I would like to change my login page template due to some javascript conflict from my main template, but I do not know how. And can I change the entire page or just Layout section?
Adding a "Security_login.ss" Template File to your Layout Folder works like a charm!
Just add "$Form" (inside the Security_login.ss Template) where you want the Login Form to be rendered.
Hello there,
Can we use our custom "Login Form" instead of using $Form in Security_login.ss.
Some thing like :
<form enctype="application/x-www-form-urlencoded" method="post" action="Security/LoginForm" id="MemberLoginForm_LoginForm">
<p style="display: none" class="message " id="MemberLoginForm_LoginForm_error"></p>
<input type="hidden" value="MemberAuthenticator" name="AuthenticationMethod" id="MemberLoginForm_LoginForm_AuthenticationMethod" class="hidden">
<div class="field text " id="Email">
<span class="field_label">Email</span><input type="text" value="" name="Email" id="MemberLoginForm_LoginForm_Email" class="text">
</div>
<div class="field password " id="Password">
<span class="field_label">Password</span><input type="password" value="" name="Password" id="MemberLoginForm_LoginForm_Password" class="text">
</div>
<p class="field checkbox " id="Remember">
<input type="checkbox" value="1" name="Remember" id="MemberLoginForm_LoginForm_Remember">
<label for="MemberLoginForm_LoginForm_Remember" class="right">Remember me next time?</label>
</p>
<div class="button">
<input type="submit" title="Log in" value="Log in" name="action_dologin" id="MemberLoginForm_LoginForm_action_dologin" class="action ">
<p id="ForgotPassword"><a href="Security/lostpassword">I've lost my password</a></p>
</div>
</form>
Many Thanks.
-Kumar Sekhar