Jump to:

5554 Posts in 1742 Topics by 1227 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Login Form : Customizing css or html

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 3620 Views
  • biapar
    Avatar
    Forum Moderator
    435 Posts

    Login Form : Customizing css or html Link to this post

    Hi,

    Where is code for login form?
    How ovveride it only for presentation/view side?

    Thank you

  • MarcusDalgren
    Avatar
    Community Member
    288 Posts

    Re: Login Form : Customizing css or html Link to this post

    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.

  • biapar
    Avatar
    Forum Moderator
    435 Posts

    Re: Login Form : Customizing css or html Link to this post

    Thank's for your reply. So, I'll try Login group redirection form, or have you a login code example?

  • encho
    Avatar
    Community Member
    2 Posts

    Re: Login Form : Customizing css or html Link to this post

    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?

  • Ironcheese
    Avatar
    Community Member
    33 Posts

    Re: Login Form : Customizing css or html Link to this post

    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.

  • Bureau Berg
    Avatar
    Community Member
    7 Posts

    Re: Login Form : Customizing css or html Link to this post

    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

    3620 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.