Jump to:

5541 Posts in 1738 Topics by 1224 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Dynamic ErrorPages

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

Page: 1
Go to End
Author Topic: 693 Views
  • neros3
    Avatar
    Community Member
    51 Posts

    Dynamic ErrorPages Link to this post

    Hi

    Im currently trying to work out how to have dynamic ErrorPages in SS.

    - What I would like is to be able, upon access restrictions, to send 403 to the browser and show a page with a dynamic message.

    - Problem right now is first of all, that when I create an ErrorPage in CMS and set errorcode to 403 the created page in assets-folder is zero kb == empty !!
    With a static errorpage I couldn't set custom errormessages like: "you are not allowed in this specific section".

    How are you dealing with 403 errors?

    Thanks!

  • neros3
    Avatar
    Community Member
    51 Posts

    Re: Dynamic ErrorPages Link to this post

    Perhaps Im all wrong with this approach... So let me try to clarify my needs a bit, perhaps someone knows about a work around.

    1. First an anonymous user tries to access a secure page.
    2. The user gets redirected to the loginpage and logs in.
    3. User still has no access to the page and 403 is sent to the browser - with a little message (ALREADYLOGGEDIN).

    - What I would like to do is to be able to show a real page, instead of just the error message, to the user.
    I have tried creating an Error Page with error code 403, but the created page in assets is empty - and still if I put text in that page it never gets displayed.

    Hope this helps...

  • neros3
    Avatar
    Community Member
    51 Posts

    Re: Dynamic ErrorPages Link to this post

    Status so far...

    The only way I've been able to actually display the 403 page (static page from assets-folder) is via allowed actions like this:

    public static $allowed_actions = array(
    "index" => "->returnsFalse"
    )

    Any help is appreciated!

    Thanks!

  • JonoM
    Avatar
    Community Member
    103 Posts

    Re: Dynamic ErrorPages Link to this post

    For anyone stumbling on this post, this might help: http://www.silverstripe.org/general-questions/show/15289

    693 Views
Page: 1
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.