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 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.

Customising the CMS /

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

User log-in and redirect to different page

Go to End

26 Posts   13120 Views

Carbon Crayon

Community Member, 598 Posts

31 March 2010 at 1:34pm

Edited: 31/03/2010 1:36pm

Hi Suntrop

the argument at the end of the line (,"Mitglieder");) is where you specify the field you want this field to be placed above. If SS can't find that field then it just won't insert the field and I think in this case the actual field name is not translated (otherwise the whole DB structure would have to be translated too. So try changing your definitions to this:

Try removing it so your field defs look like this:

public function updateCMSFields(FieldSet &$fields) { 
    $fields->addFieldToTab("Root.Mitglieder", new CheckboxField("GoToAdmin", " Go to Admin area"), "Members"); 
    $fields->addFieldToTab("Root.Mitglieder", new TreeDropdownField("LinkPageID", "Or select a Page to redirect to", "SiteTree"), "Members"); 

Hope that helps

Aram - SilverStripe tutorials tips and other bits.


Community Member, 141 Posts

31 March 2010 at 9:09pm

Hi Aram.
It helps :-) I surmised something like that but didn't know where to look at. Where do I find infos about the CMS functions?

I really start to love SilverStripe :-) However, I have to dig much deeper into the code ...



Community Member, 141 Posts

31 March 2010 at 9:40pm

I am sorry, but I have to ask again. The TreeDropdown doesn't save its value. When I reload the page it says 'Select' instead of my selection I did before.

Where do I check what's wrong? Which part of the script saves the data?

Carbon Crayon

Community Member, 598 Posts

1 April 2010 at 12:41pm

hmm, make sure your has_one relationship is called LinkPage and not LinkPageID. Also check the database to make sure the field 'LinkPageID' has been created on group.

Aram - SilverStripe tutorials, tips and other bits


Community Member, 141 Posts

3 April 2010 at 7:44am

Thanks! That helps. It was called LinkPageId and I renamed it to LinkPage



Community Member, 267 Posts

28 April 2010 at 8:06pm

Edited: 28/04/2010 8:06pm

- First of all: does this script work?

- Which _config.php do I need to edit? In the mysite folder? or sapphire, or cms?

- Where do I need to place (which folder) 'CustomLogin.php'?

--> Changed the _config.php in mysite and uploaded it. Also added 'CustomLogin.php' in the 'mysite/code'
--> Did a dev/build
--> Refreshed the CMS log-in, but no checkbox under Security.
--> Using English SS 2.3.7

What to do? Really need this.


Community Member, 267 Posts

29 April 2010 at 8:04pm

Ok found my error!

I added the lines into the default SilverStripe _config.php

and what I should have done was download the _config.php from my server, add the extra lines/code, and reupload it.

now it works spledit! :D


Community Member, 14 Posts

6 August 2010 at 2:33am

Nice, works like a charm :)
Now i have a little question...
Is it possible to redirect a user to a specific page in the CMS backend (i have users who can edit only certain pages, would be nice if they were redirected there without the need to manually browse the site tree)? And how?