Skip to content

Instantly share code, notes, and snippets.

@unclecheese
Created October 1, 2014 21:56
Show Gist options
  • Save unclecheese/8d6b91070b9dac56ef66 to your computer and use it in GitHub Desktop.
Save unclecheese/8d6b91070b9dac56ef66 to your computer and use it in GitHub Desktop.
Custom login for SilverStripe
class Page extends SiteTree {
public function IsLostPassword() {
return in_array(Controller::curr()->getRequest()->param('Action'), array("lostpassword","passwordsent","changepassword"));
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<% base_tag %>
<! -- scripts, css, etc -->
</head>
<body class="login-form">
$Content
$Form
</body>
</html>
<% if IsLostPassword %><% include LostPassword %><% else %>
<!DOCTYPE html>
....
</html>
<% end_if %>
<!DOCTYPE html>
<html lang="en">
<head>
<% base_tag %>
<! -- scripts, css, etc -->
</head>
<body class="login-form">
$Form
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment