Yes you can:
in security -> underneath the checkbox 'go to admin area'
it says:
'Or select a Page to redirect to'
select your redirect page.
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
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.
Yes you can:
in security -> underneath the checkbox 'go to admin area'
it says:
'Or select a Page to redirect to'
select your redirect page.
Tried that, but when i select a page to redirect to the user logs in and is redirected to the frontend page i've choosen, while i want him to be redirected to that page but INSIDE the cms, so he can start editing his page as soon as he logs in. Does it make sense?
Thanks for your help :)
Hi Balder
all you need to do is change the way the redirect link is contructed, so this bit of code:
//Get the page that is referenced in the group
$Link = DataObject::get_by_id("SiteTree", "{$Group->LinkPageID}")->URLSegment;
Becomes this:
//Get the page that is referenced in the group
$Link = "admin/show/$Group->LinkPageID";
Untested but that should do it ;)
Aram
www.SSbits.com - SilverStripe Tutorials, Tips and other bits
OK, i solved it thanks to this thread: http://www.silverstripe.org/general-questions/show/257647
----------------
The way to do this is to have the link be /admin/show/$ID of the page you want to redirect to. So I image you extract the Id from the TreeDropdownField and insert it into the redirector so change these lines:
$Link = DataObject::get_by_id("SiteTree", "{$Group->LinkPageID}")->URLSegment;
to this:
$ID = DataObject::get_by_id("SiteTree", "{$Group->LinkPageID}")->ID;
And this line:
Director::redirect(Director::baseURL() . $Link);
to this:
Director::redirect(Director::baseURL() . "admin/show/" . $ID);
------------------------
[edit]
You were faster :)
And that works by the way, so thanks a lot!
/\ My way is simple ;)
Just one more question to clean things up: when redirecting, the browser now displays a page with the following text:
-----------------
done
Redirecting to /myurl/admin/show/86... (output started on /.../mysite/code/CustomLogin.php, line 10)
--------------
And then redirects.
Is it possible not to display that page?
Hmm yea I have had that before, but not sure if/how you can get rid of it :s
Annoying...
Well that was easy :)
I just deleted the following on CustomLogin.php, line 10, which i guess was a leftover from the code i copied ;)
--------------
echo 'done';
--------------