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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Template Questions /

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

How to detect cms login page


Go to End


7 Posts   3650 Views

Avatar
subpixel

Community Member, 4 Posts

30 August 2010 at 8:11pm

I use for logging to cms page site.com/admin. It uses my page template, however I'd like to remove some elements in this login page.
I tried following two with no luck

<% if LoginForm %>
<% if URLSegment == admin %>

Any ideas? I'd prefer not to override Page.ss with LoginPage.ss
Using SS 2.4.1

Avatar
Willr

Forum Moderator, 5523 Posts

30 August 2010 at 9:35pm

The default login / logout screens are part of the Security controller so you can make a Security.ss file to override the Page.ss styles.

Avatar
subpixel

Community Member, 4 Posts

30 August 2010 at 9:52pm

Thanks, it's good to know.
However is it possible to detect it via any property. I'm looking for something like

<% if Security %><% include .. %>

Avatar
zenmonkey

Community Member, 545 Posts

9 October 2010 at 3:03am

Security pages have an ID=0 which i think I've used as a hacky way of manipulating their templates in the past

Avatar
Willr

Forum Moderator, 5523 Posts

9 October 2010 at 10:37am

You can also use classname = <% if ClassName = Security %>

Avatar
hp777

Community Member, 13 Posts

28 December 2014 at 6:01am

Anyway to do this in 3.x ?

Avatar
helenclarko

Community Member, 166 Posts

12 January 2015 at 2:16pm

I'll just leave this here...

<% if URLSegment == Security %>