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.

Form Questions /

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

Login Form on new page type?


Go to End


3 Posts   1954 Views

Avatar
RyFridge

Community Member, 1 Post

27 July 2014 at 10:57pm

Edited: 27/07/2014 11:21pm

Hello everybody,

I have a question that i thought couldn't be that hard to answer, but I just can't find a solution, since i'm new to Silverstripe and don't understand most of it yet.
I created a single page website that loads all main pages from the CMS into one big page, and naturally, i put the CMS admin login form at the very bottom of the page, which works great but looks stupid.
Now i created a new AdminPage.php and build it, gave it a AdminPage.ss with a separate css file and only $Content and $Form in the body.
After that i created a new page in the CMS under my "home" page and called it "login", gave it the page type "AdminPage". It loads fine in the browser, the new css is accepted as well.
The only problem: the $Form ist simply not visible. The page is entirely empty besides the visual style and the $Content.

Thanks in advance, Ry

Avatar
micmania1

Community Member, 9 Posts

28 July 2014 at 3:34pm

The login form won't show as it doesn't belong to the page - it belongs to the Security controller which is accessible through /Security.

Its probably best to structure your templates differently to how you currently have them. If you can list your structure before I should be able to give you some advice.

Avatar
nzstephenf

Community Member, 63 Posts

28 July 2014 at 6:09pm

You can call the login form by using the $LoginForm variable in your template! Hope that helps :)