Jump to:

1347 Posts in 439 Topics by 514 members

Themes

SilverStripe Forums » Themes » Own Theme, Login not Working

Discuss SilverStripe Themes.

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

Page: 1
Go to End
Author Topic: 1890 Views
  • patrick_fraley
    Avatar
    Community Member
    1 Post

    Own Theme, Login not Working Link to this post

    Hi all,

    I am pretty new to SilverStripe. I converted my own HTML Template to a set of SilverStripe Templates. So far it was pretty easy.

    Now I did encounter one problem. When I call the admin page I get the Login form, but when I enter my credentials and click login I get redirected to an empty page and when I open the admin page again, I am asked again to login.

    What did I forget to do in my Templates, so that login will work?

    Here is the Site:

    http://fde-ss.secure.homelinux.net/

  • blinder
    Avatar
    Community Member
    2 Posts

    Re: Own Theme, Login not Working Link to this post

    i'm seeing the same exact thing and the problem is that the action attribute for the form tag is:

    Security/LoginForm

    (notice the missing leading slash)

    now... i tried in my Layouts/Page.ss to include: $LoginForm -- which fixes this (the action attribute is: /Security/LoginForm), but has the very bad side effect of including the login form on every single page (very bad)

    i'm wondering if this is a bug?

  • blinder
    Avatar
    Community Member
    2 Posts

    Re: Own Theme, Login not Working Link to this post

    so i came up with a hack-ish "fix" for this. In my: [theme]/Layout/Page.ss i have this little snippet of code:

    <% if URLSegment == Security %>
    $LoginForm
    <% end_if %>

    Basically this uses the $LoginForm (which has the correct form action attribute) but will only include that on the Security/login page. Not great, and i'm sure the silverstripe folks will have something significantly better than this, but it got me around the problem.

  • wfrostfire
    Avatar
    Community Member
    1 Post

    Re: Own Theme, Login not Working Link to this post

    got the same problem. blinder's fix works like a charm :3

  • Tobi Oetiker
    Avatar
    Community Member
    6 Posts

    Re: Own Theme, Login not Working Link to this post

    Make sure you have {$Content}{$Form} in your Layout/Page.ss and not only {$Content}.

    cheers
    tobi

  • matt.saddington
    Avatar
    Community Member
    1 Post

    Re: Own Theme, Login not Working Link to this post

    Thanks, for that hack really helped alot. Im assuming its a silverstripe bug, with the link generation having issues when the theme is changed.

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