Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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



6 Posts   1720 Views


21 February 2009 at 1:59am (Last edited: 21 February 2009 2:28am), Community Member, 199 Posts


I'm using the $LoginForm in my template as follows:

<% if CurrentMember %>
You're logged in as: $CurrentMember.FirstName
<% else %>
<% end_if %>

1) Where do i edit the CSS for this?
2) It has an email & password field and a 'login' and 'i've lost my password' button. When logged in, i would like the user to have a 'logout' option. How do i create this? Is there something like a $Logout piece of code?

Many thanks in advance!

edit: I ended up just adding the following code to log out:

<a href="Security/logout"><h3>LOG OUT</h3></a>


21 February 2009 at 2:04am Community Member, 199 Posts

Sorry... I see that this form uses the same CSS as the cms/admin. Is it possible to have them looking different?


21 February 2009 at 5:09am Community Member, 598 Posts

you could wrap the $LoginForm in a div:

<div id="customLoginForm">

and then use that selector to syle the fields:

div#customLoginForm fieldset label{
//custom style

Probably the easiest way to approach it would be to copy all the styles that apply to the login form and then just add #customLoginForm inform of them and start editing, that way you know that it will always have one more selector and so will overwrite the default styling :)


21 February 2009 at 5:37am (Last edited: 21 February 2009 5:37am), Community Member, 199 Posts

Great. Thanks Aram, i'll give that a try.


2 April 2009 at 4:03am Community Member, 108 Posts


Hi. Were you able to gain control over the layout of the $Loginform?

I"m curious how you did this. I need to change the layout of the $Loginform but simply can't get there.

Can you share your thoughts?

Terry Middleton


19 December 2009 at 2:29am Community Member, 30 Posts

Hello Briohny
thank you for your code,it helped me in creating the link for logout
but when i click on logout link though the session is logged out but it is redirect to the same page,I want to redirect it to home page
Can anyone help me in redirecting to home page after clicking on logout.
Thank you in advance