Jump to:

5540 Posts in 1738 Topics by 1224 members

Customising the CMS

SilverStripe Forums » Customising the CMS » User log-in and redirect to different page

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

Page: 1 2 3 4
Go to End
Author Topic: 6825 Views
  • Aram
    Avatar
    Community Member
    598 Posts

    Re: User log-in and redirect to different page Link to this post

    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.

  • suntrop
    Avatar
    Community Member
    131 Posts

    Re: User log-in and redirect to different page Link to this post

    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

  • suntrop
    Avatar
    Community Member
    131 Posts

    Re: User log-in and redirect to different page Link to this post

    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?

  • Aram
    Avatar
    Community Member
    598 Posts

    Re: User log-in and redirect to different page Link to this post

    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

  • suntrop
    Avatar
    Community Member
    131 Posts

    Re: User log-in and redirect to different page Link to this post

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

    Cheers
    suntrop

  • borriej
    Avatar
    Community Member
    267 Posts

    Re: User log-in and redirect to different page Link to this post

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

  • borriej
    Avatar
    Community Member
    267 Posts

    Re: User log-in and redirect to different page Link to this post

    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!

  • balder
    Avatar
    Community Member
    14 Posts

    Re: User log-in and redirect to different page Link to this post

    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?

    6825 Views
Page: 1 2 3 4
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.