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?
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")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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) { $(".someContents").hide(); } });
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.