Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

Matthew J. Horn
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 31, 2013

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

1 vote
Jason Hensler
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 31, 2013

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").

Matthew J. Horn
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 31, 2013

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")

...
1 vote
Carsten A.
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 31, 2013

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") &gt; -1) {
		$(".someContents").hide();
	}
});

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events