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.

We've moved the forum!

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.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

Site wide login / logout area


Go to End


2 Posts   1741 Views

Avatar
Dana

Community Member, 1 Post

18 September 2008 at 12:37pm

Hi All,

I'm brand new to the CMS and am testing functionality and starting some development with it. So far it seems great. One question though. I want to have a site wide login form at the top right corner of my site. This would turn to "logout" when the user has logged in. What is the best way to accomplish this?

thanks

Avatar
Liam

Community Member, 470 Posts

18 September 2008 at 1:47pm

Use the variable $LoginForm in your template.

This will redirect users to the admin area.

If you need to customize the form further beyond CSS, there is a login form widget which just has the html code that is outputted from $LoginForm (or you could copy it yourself from the output). You can customize that and change the hidden form variable which redirects to the admin page. Can be anything you want.