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.

Archive /

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

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

Creating a Website Login and how to register members into the database


Go to End
Reply


11 Posts   5407 Views

Avatar
PassePartout

Community Member, 21 Posts

26 June 2008 at 7:14am

Edited: 08/07/2008 2:06am

Hello,

I have wishing to have my website be private, and thus this would require a login page, a page for the user to register and a page for sending/retrieving lost passwords.

I am unsure as of how to do this and have had advice ranging from using canView() to riping the forum module's code. I am new to SS and either of these methods is a little over my head right now.

Could I please get some help, thanks

Avatar
PassePartout

Community Member, 21 Posts

26 June 2008 at 8:53am

Ok so I worked out a couple noob issues. I'm not sure why I could never find the access tab (yes I did try and find it before, I guess I got confused reading and thought it was supposed to be on the security tab for some reason). I am now on my way (aka going to do this tomorrow) to making a registration form (any tips anyone? any problems that people know I might encounter?).


One question I still have is how to create a simple login for users that could be a box for user/pw and a button rather than have the whole security/login page (aka I want to make the login for users cleaner and smaller).


Cheers

Avatar
dio5

Community Member, 501 Posts

26 June 2008 at 9:12am

Re login box: you can just have $LoginForm in the template, which will render a simple loginform with email/pw and a submitbutton...

Avatar
gkinane

Community Member, 22 Posts

27 June 2008 at 4:21am

Hi Dio5

When you talk about :
Re login box: you can just have $LoginForm in the template, which will render a simple loginform with email/pw and a submitbutton...

Where is $loginForm to be added , which template.

Totally new to Silverstripe so excuse the ignorance.

Gerry

Avatar
PassePartout

Community Member, 21 Posts

27 June 2008 at 8:35am

Hey Gerry,

you include the $LoginForm in whichever template you wish to have it in (e.g. "..tutorial/theme/template/"). Personally, I put it in my include folder under something like Login.ss which really only has the [url=http://pastebin.com/m2eea99f5]$LoginForm and some code which keeps it fiting in my theme[/url]. I had to fool around with the css to get it looking better and ended up using ID tags (in css that is "#idname{}") and messed with the padding and so forth to get it all looking tidy. If you don't have it already, make sure to get Firebug (firefox addon, press F12 to bring it up and "Inspect" objects).


So I hope that helps you out with the "just put it in templates". Basically, it's treated like $Content and all of those things, so you just need to put the code in any template and it does the rest. I just [url=http://pastebin.com/m2a16ec4c]included my login when needed[/url] and left it out of my templates.

Avatar
PassePartout

Community Member, 21 Posts

27 June 2008 at 8:39am

As for the $LoginForm, are there other things like this that are indexed? e.g. is there a $RegisterForm or anything like that? If so, where would I look? I know I could browse http://api.silverstripe.com/ but I'm just wondering if there's anything else or if I hold the answer to my question already :)

Avatar
Willr

Forum Moderator, 5513 Posts

27 June 2008 at 9:19am

There is a list of methods you can call in templates on the Page Controls page

http://doc.silverstripe.com/doku.php?id=built-in-page-controls

http://doc.silverstripe.com/doku.php?id=built-in-page-controls#quick_reference

Avatar
dospuntocero

Community Member, 54 Posts

7 July 2008 at 9:36am

Edited: 07/07/2008 9:38am

well it seems not to exist a $RegisterForm variable, but a $LoginForm... this loginForm is for the CMS, not for a custom made private section

Go to Top