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, Ed, biapar, Willr, Ingo, swaiba

Custom Login Forgot Password Page Template

Go to End

4 Posts   5045 Views


Community Member, 18 Posts

24 August 2009 at 3:22pm


I have created a Custom Login page using How do I do the same for the 'I've lost my password' page. For example, when you click on the 'I've lost my password' link, it takes you to another page that uses the sites when in fact I want it to use a custom page similar to the custom login page I have already created? I did try using the but that seems to be used just for customizing the content that is sent to the email address and not for creating a custom forgot password email page.

Any help would be greatly appreciated.


Community Member, 283 Posts

25 August 2009 at 5:38am

Edited: 26/08/2009 2:31am

EDIT: I seriously overcomplicated the matter here, see next post for the best answer.

The lost password section doesn't use a .ss template file. A 'virtual' page is created and rendered when you go to You have 2 options that I can think of:

1. Go in and change the page under /sapphire/security/Security.php starting at line 376
This is the easiest and will get it done for you but it is NEVER a good idea to modify a framework's code. Your site will break if you upgrade.

2. Extend the Security object and override the lostpassword() function to use your own code that renders with a template. You would then have to switch out the existing Security object in one of your _config.php files:


This is the "right" way to do it but does require some custom coding.


Community Member, 271 Posts

25 August 2009 at 9:48am



Community Member, 18 Posts

26 August 2009 at 12:07am

@dalesaurus Thank you. Yes, agree, I wanted to avoid modifying the framework itself. Using works as suggested by Martijn.

@martijn Thanks. This works perfectly!