function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
KT@CiscoKT@Cisco 

How to display a custom title on a VisualForce page? Need help <apex:page> tag

I have installed an application called CaseHistory from appExchange and wanted to modify the relevant VisualForce page - CaseHistory.page.

 

I attempted to use the title attribute of the <apex:page> tag as follows:

<apex:page showHeader="false" controller="CaseHistoryController" title="Case: {!aCase.CaseNumber}">

 

However, I keep seeing the title as "Page Editor - /apex/CaseHistory". I changed my user setting to NOT be in Developer mode but I still don't see the page title changed to what I was trying to set in the code above (Case: caseNumber).

 

Any ideas on how to resolve this?

 

Thanks in advance,

Komal

Best Answer chosen by Admin (Salesforce Developers) 
paul-lmipaul-lmi

if you set showHeader to false, you need to put your own head and title tags in the page, like

 

 

<apex:page>
<head>
<title>Case: {!aCase.CaseNumber}</title>
</head>

...content...

</apex:page>

 

 

All Answers

paul-lmipaul-lmi

if you set showHeader to false, you need to put your own head and title tags in the page, like

 

 

<apex:page>
<head>
<title>Case: {!aCase.CaseNumber}</title>
</head>

...content...

</apex:page>

 

 

This was selected as the best answer
KT@CiscoKT@Cisco

Thanks for the prompt response. However, even that doesn't work.

 

The TITLE gets overwritten with "

<title>Page Editor - /apex/CaseHistory</title>" even though I have explicitly defined the TITLE in the HEAD tags.
paul-lmipaul-lmi

it sounds like it still thinks your in page developer mode (developer mode checkbox on your user setup page).  it could also potentially still be using a cached copy of your page.  this is definitely how it's done though, straight from premier dev support when we ran into the same issue a while ago.  if it's still not working for you, you may want to open a case with support.

KT@CiscoKT@Cisco

Thanks Paul

 

I reset my development mode flag and cleared the cache and it worked.

Marc C.Marc C.

btw. It's inadvisable to set showHeader to false to achieve this. Just set the title attribute on the page:

<apex:page title="My Page"...

 

That way you don't lose the SalesForce border etc.

jaw999jaw999
Need more help here - My page title comes from nothign anyway on my page. My header is:
<apex:page standardController="Opportunity"  showHeader="true" sidebar="true" title="{!Opportunity.Name}" cache="false">


In development mode, my page title is "Page Editor - (vf page name)"
Out of development mode, my page title is "Needed Documentations" a phrase that does not exist in my page.
Richard DiNardo 6Richard DiNardo 6
I have found the best way to accomplish this after the initial <apex:page> opening tag use java script

<script>
  document.title = "My Custom Title";
</script>