You need to sign in to do that
Don't have an account?
Retrieving Page name
I'm trying to render the name of a VisualForce page as a CSS style so that i can have a dynamic header image on VF pages on my site. Is there some way to do this using the PageReference class? I've tried the following but it doesn't look like the class has any sort of property or method for the name:
public static String getPageName(){
PageReference ref = ApexPages.currentPage();
return ref.getName();
}
I've also tried the global variable $CurrentPage.Name in the VF page but i need to be able to perform a string operation on the page name, and $CurrentPage.Name.split('_', 2) generates an error.