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.

Customising the CMS

User log-in and redirect to different page


Reply

26 Posts   6969 Views

Avatar
Carbon Crayon

31 March 2010 at 1:34pm (Last edited: 31 March 2010 1:36pm), Community Member, 598 Posts

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

www.ssbits.com - SilverStripe tutorials tips and other bits.

Avatar
suntrop

31 March 2010 at 9:09pm Community Member, 131 Posts

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

Thanks
suntrop

Avatar
suntrop

31 March 2010 at 9:40pm Community Member, 131 Posts

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?

Avatar
Carbon Crayon

1 April 2010 at 12:41pm Community Member, 598 Posts

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

www.SSBits.com - SilverStripe tutorials, tips and other bits

Avatar
suntrop

3 April 2010 at 7:44am Community Member, 131 Posts

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

Cheers
suntrop

Avatar
borriej

28 April 2010 at 8:06pm (Last edited: 28 April 2010 8:06pm), Community Member, 267 Posts

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

Avatar
borriej

29 April 2010 at 8:04pm Community Member, 267 Posts

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

Avatar
balder

6 August 2010 at 2:33am Community Member, 14 Posts

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?