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.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

CMS page changed with theme change


Go to End
Reply

9 Posts   1758 Views

Avatar
Moose

23 January 2009 at 8:33am Community Member, 26 Posts

Hi.

I'm on day 2 of SS discovery. Having a blast and looking forward to really getting my teeth into it.

I am having an obscure problem that I see was reported in an archived forum post - there didn't seem to be much of a resolution. I have created a custom theme, defined a new Page.ss and edited the _config file to set the theme. The problem is that when I now try to log in to the CMS I see my new Page.ss (the $Content variable gives "Enter your email address and password to access the CMS." and, obviously, there are no fields etc. I have attached the screenshot - excuse the embarrassing design.

I haven't changed anything in the CMS folder - I see that there are a bunch of templates there but can't see which would render the log in page.

Any help would contribute to my marginal sanity!
Thanks

PS: I notice that this $%ppy table-based layout fails in Firefox - it's fine in IE. I'd be interested if anyone can point out why that may be the case - I've emptied layout.css...

Attached Files
Avatar
dio5

23 January 2009 at 8:47am Community Member, 501 Posts

Just to make sure, have you added the $Form variable as well?

cheerz

Avatar
Moose

23 January 2009 at 9:31am Community Member, 26 Posts

No. My intention was not to modify the way the CMS works yet at all. I assumed that it is entirely independent of any new theme I define...

Avatar
dio5

23 January 2009 at 10:12am Community Member, 501 Posts

You need the $Form variable on your templates/Layout/Page.ss in order to see the form fields.

Avatar
Moose

23 January 2009 at 10:21am Community Member, 26 Posts

I'm sorry - I don't understand. Are you saying I have to build the log in page from scratch if I define a new theme? I would have thought that the CMS would be unaffected by the addition of a theme...

I must be missing something here!

Avatar
dio5

23 January 2009 at 10:30am (Last edited: 23 January 2009 10:30am), Community Member, 501 Posts

Noo! :)

In the template Page.ss where you have $Content, you also need to add in $Form. Only that tag or variable or how you want to call it.

If you don't have $Form in it, it won't render the loginform.

Avatar
Moose

23 January 2009 at 10:25pm Community Member, 26 Posts

Thanks... I think I may understand the source of my confusion. If I'm not mistaken, the login page is rendering based on the Page.ss specification of the active theme. This is backed up by the fact that if I include the $Form variable in my Page.ss I can log in and the CMS then renders as expected.

This still seems strange to me - surely the log in page should render according to an independent template? Is there a way of achieving this?

Avatar
Willr

25 January 2009 at 3:23pm Forum Moderator, 5511 Posts

The login form is rendered in the default Page.ss template, if you want a custom login template you can create a Security_login.ss template in your themes templates/Layout folder

Go to Top