Customizing Confluence's Login page -- check for current page in global decorator?

I am customizing my site's Login/Logout page. Most of the HTML that renders the page is in the Main Layout decorator (/admin -> Look and Feel -> Layouts -> Main Layout).

What I'd like to do is modify that decorator to check if the current page is the login page. If it is, I'd like to hide/show certain parts of the header and footer.

Does anyone have a quick way to check which page is being drawn, or maybe which action is being used to draw that page?

2 answers

How about checking current web-adress via javascript/jquery and show/hide the parts of header and footer according to that via jquery as well?

$(document).ready( function() {
	var yourUrl = window.location.href;
	if(yourUrl.indexOf("whereYou.WantTo.Be") > -1) {

I could be wrong but, I believe for the login page, the velocity template that generates it is the file call login.vm. It's found on the disk in the folder <confluence root install>confluence\login.vm. I don't believe that the login page is calling or being called from the main.vm file.

Additionally, you could check most pages by doing #if($page.title == "something") for pages layout. In the main layout I think it would just be #if($title == "something").

The VM file that defines some of the elements is layout.vm. But I define my header and footer in the global page layout decorator. So, yes, I conditionalized some of the layout items using:

#if ($sitemeshPage.getTitle().trim() == "Log In")


Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

901 views 23 12
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you