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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

CMS page changed with theme change


Go to End


9 Posts   3857 Views

Avatar
Moose

Community Member, 26 Posts

23 January 2009 at 8:33am

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

Community Member, 501 Posts

23 January 2009 at 8:47am

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

cheerz

Avatar
Moose

Community Member, 26 Posts

23 January 2009 at 9:31am

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

Community Member, 501 Posts

23 January 2009 at 10:12am

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

Avatar
Moose

Community Member, 26 Posts

23 January 2009 at 10:21am

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

Community Member, 501 Posts

23 January 2009 at 10:30am

Edited: 23/01/2009 10:30am

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

Community Member, 26 Posts

23 January 2009 at 10:25pm

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

Forum Moderator, 5523 Posts

25 January 2009 at 3:23pm

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