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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

2,852 views 27 11
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