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.

General Questions /

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

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

Editor for Login Page


Go to End


6 Posts   2843 Views

Avatar
steve_nyhof

Community Member, 224 Posts

10 March 2011 at 6:02am

I have been wanting to find a way to add a Login page type so that I can edit the content on the login page...

http://mywebsite.com/Security/login

Several things would be nice here...

One, being able to change and edit the content on this page, as an extension to the Page type

But also, for visitors wanting to access a private page, the system now just tells them they do not have permission, but no further instruction as to what to do. So they leave frustrated. I want to be able to tell them that they need to sign up, or something, offering a link to do what they want to do.

I'm not sure if these functions would be able to be handled in the same Login.php and Login.ss files?
I would think a page with several tabs for each situation would be cool!

And direction and example code would be appreciated.

Thank you,
Steve

Attached Files
Avatar
Willr

Forum Moderator, 5523 Posts

10 March 2011 at 2:16pm

You can specify your own template for the login page. Make a Security.ss (or Security_login.ss) file in your themes template/Layout directory and you can customize it how you wish. If you want to add a CMS content editable element to it you could do so but putting the field on the SiteConfig panel then calling it in the template $SiteConfig.LoginText.

See http://doc.silverstripe.org/sapphire/en/reference/siteconfig for information about adding fields to SiteConfig.

Avatar
steve_nyhof

Community Member, 224 Posts

10 March 2011 at 3:46pm

Thank you Willr!
I will have my programmer take a look at your content here
Steve

Avatar
steve_nyhof

Community Member, 224 Posts

16 March 2011 at 3:40am

Can this be applied to 2.3 ? Can you offer a simple example?

Avatar
Willr

Forum Moderator, 5523 Posts

17 March 2011 at 8:32pm

No, SiteConfig was introduced in 2.4 so you cannot create a site config interface for it in early versions. You could put the CMS fields on another pagetype (homepage is normally a good option).

You should be able to do a custom template for Security at least for 2.3. Not really an 'example' to show, just make a Security_login.ss template file in your themes layout folder (or a Security.ss for all the security section).

Avatar
steve_nyhof

Community Member, 224 Posts

18 March 2011 at 2:20am

Thank you. My programmer said that it would take 2.4 also, and we have already started with many changes to 2.4, and will implement it there.