Jump to:

3393 Posts in 976 Topics by 852 members

Template Questions

SilverStripe Forums » Template Questions » How to detect cms login page

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

Page: 1
Go to End
Author Topic: 1413 Views
  • subpixel
    Avatar
    Community Member
    4 Posts

    How to detect cms login page Link to this post

    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

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: How to detect cms login page Link to this post

    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.

  • subpixel
    Avatar
    Community Member
    4 Posts

    Re: How to detect cms login page Link to this post

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

  • zenmonkey
    Avatar
    Community Member
    524 Posts

    Re: How to detect cms login page Link to this post

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

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: How to detect cms login page Link to this post

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

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