I've extended my SilverStripe installation with a user registration page. I've altered a BackURL variable to the links to the login and regsitry pages.
However, how can I include the BackURL in my altered login template to include a message that they can register for an account?
themes/mytheme/templates/Layout/Security_login.ss
$Content
Login below or <a href="{$BaseHref}register?BackURL={$BackURL}">register for an user account</a>.
$Form
<a href="{$BaseHref}register?BackURL={$BackURL}">Register for an user account</a>
The BackURL is added to the Form itself, but not to the 'register user account' links.
I've tried adding a CustomLoginForm, but the BackURL information isn't available in the Security_login.ss (as it will probably need to be added to the Controller but I can't find the Form Controller.
<?php
class CustomLoginForm extends MemberLoginForm {
public function BackURL() {
if(isset($_REQUEST['BackURL'])) {
return $_REQUEST['BackURL'];
} else {
return Session::get('BackURL');
}
}
}
Any help would be appreciated.