FYI: Changing Template Content Based on being on Security/login page or not...

I wanted to alter the page layout based on whether or not the active page was ‘Security/login’.

This is what we did to solve the issue of determining if the current page is the Security/login page or not. We placed the following code into the page controller:

public function IsLoginFormPage() {
        $controllerSitetree = Director::get_current_page();
        if($controllerSitetree instanceof Security){
            $activePage = $controllerSitetree->getRequest()->getURL();
            if($activePage === "Security/login"){
                return true;
        return false;

and this in the template:

<% if $IsLoginFormPage %>
        <% else %>
            <div class="col-md-12">
                <div class="video">    
                    <span class="video-height"></span>    
                    <iframe src="" frameborder="0"></iframe>
            <% include SignupForm %>
        <% end_if %>

That enabled us to embed our video (YouTube) with modest branding and autoplay on if the page was not the login page.

Also had this suggestion given to me after the fact, which has pros and cons compared to my solution:

The solution was to create and not properly namespace in my theme.

In the file does not use Template namespacing and you use $Form rather than $LoginForm where you want the form to be embedded in the template.