customize browser tab title

  • 2
  • Question
  • Updated 4 years ago
  • Answered
when viewing a standard SFDC page, the title starts with "object name: name record name" (second tab in the screenshot attached).  when viewing a skuid page, the title equals "salesforce.com - Enterprise Edition" (first tab in the screenshot).  i'd like to override the tab title for skuid pages to match the format of the standard pages. 

here's the visualforce page:

<apex:page action="{!redirect}&page=LeadDetail" extensions="skuid.Redirects" standardController="Lead">
</apex:page>

any ideas?
Photo of Will Soupcoff

Will Soupcoff

  • 734 Points 500 badge 2x thumb

Posted 5 years ago

  • 2
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,968 Points 20k badge 2x thumb
Will, try VF code that looks like this:

<apex:page standardController="Lead" extensions="skuid.Redirects" 
       showHeader="true" sidebar="false" readonly="true" docType="html-5.0"
       action="{!IF(canUseSkuid,'',redirect)}" title="{!Lead.Name}">
    <skuid:page page="LeadDetail" />
</apex:page> 

(Edited)
Photo of Will Soupcoff

Will Soupcoff

  • 734 Points 500 badge 2x thumb
Thanks, Rob!
Photo of Elissa Bradley

Elissa Bradley

  • 1,938 Points 1k badge 2x thumb
This doesn't seem to work with Page Assignments (I have different Skuid pages displayed for different Record Types). 

In my Visualforce Page, I use this: 

<apex:page standardController="Case"  extensions="skuid.Redirects" 
action="{!redirect}?objectType=Case&actionType=view"
</apex:page>

What should I use as my action if I want to rename the tab?  Seems like the "action" part of the below if the problem: 

<apex:page standardController="Case"  extensions="skuid.Redirects" 
showHeader="true" sidebar="false" readonly="true" docType="html-5.0"
action="{!IF(canUseSkuid,'',redirect)}"  title="{!Case.Subject}">
</apex:page>
 

 
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,968 Points 20k badge 2x thumb
Here is the code we use in our org for view case.  
<apex:page standardController="Case" tabStyle="Case" title="{!$ObjectType.Case.label}: {!Case.CaseNumber}" 
extensions="skuid.Redirects" action="{!IF(canUseSkuid,'',redirect)}"
sidebar="false" readOnly="true" docType="html-5.0">
<skuid:page objecttype="Case" actiontype="View"/>
</apex:page>
(Edited)
Photo of Elissa Bradley

Elissa Bradley

  • 1,938 Points 1k badge 2x thumb
Works perfectly - thank you!
Photo of Elissa Bradley

Elissa Bradley

  • 1,938 Points 1k badge 2x thumb
oh...actually...it works until I open a pop-up on a page include from the case page.  

When I do this, the pop-up doesn't show the proper page (should show a different object)...it just shows my Salesforce header.  

Thoughts?  
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,968 Points 20k badge 2x thumb
I believe thats a different issue (If I understand you correctly).  It sounds like the page include code is not finding a page to connect to and is reverting to the empty saleforce header. 
Photo of Elissa Bradley

Elissa Bradley

  • 1,938 Points 1k badge 2x thumb
The funny thing, though, is that the page include works just fine when the parent page is displayed using this Visualforce code: 

<apex:page standardController="Case"  extensions="skuid.Redirects" 
action="{!redirect}?objectType=Case&actionType=view"
</apex:page>

When I update to the code you provided above, the page include no longer displays the appropriate page.  (Page Include should show an object called MedRec__c, which has its own Visualforce page override.  I did not change the MedRec__c Visualforce page.)
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,968 Points 20k badge 2x thumb
Hmm.  A couple of random thoughts:

1.   I know we've had some bugs with using the "Page Assignment" type of page include.  You might try simply wiring the page include directly up to a skuid page.  

2.  The core part of my code that updates what shown in the tab is the line:  title="{!$ObjectType.Case.label}: {!Case.CaseNumber}"     You might just add that to your working VF code and see if we get the best of both worlds. 
Photo of Rimali Gurav

Rimali Gurav

  • 272 Points 250 badge 2x thumb
Hi Rob,

I have skuid page with different tiles on it which redirect to Account , campaign list pages.That open in new page.
Now when i open in new page i want change the tab name in browser is tthat possible?
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,968 Points 20k badge 2x thumb
Yes it is possible.  Just set up a VF override page as shown above,  with the tab style and info properties you want.  Then make your tiles link to this VF page,  or to the object/action item you use it to override. 
Photo of Rimali Gurav

Rimali Gurav

  • 272 Points 250 badge 2x thumb
Thank you so much Rob its done...
Photo of Elissa Bradley

Elissa Bradley

  • 1,938 Points 1k badge 2x thumb
Hi Rob, 

I'm revisiting this issue - to recap:

 - I'm able to set the browser tab name by using the code your provided, but it messes up any page includes on the main page.  I re-read your comment about using the "Page Assignment" type of page include - I'm not using that, and am still having the issue.  I also tried just adding a title to my VF page (title="{!Case.Subject}"), but that has no affect on the browser tab.  

Just wondering if you have any new thoughts on this.  I realize the work-around may be to reproduce the content of my page include in the main page, but it's complex and I use it elsewhere...I'm worried about scalability when I need to edit it.

Thanks for any thoughts you have on this!
Photo of Elissa Bradley

Elissa Bradley

  • 1,938 Points 1k badge 2x thumb
Hi Rob, 

I'm revisiting this issue - to recap:

 - I'm able to set the browser tab name by using the code your provided, but it messes up any page includes on the main page.  I re-read your comment about using the "Page Assignment" type of page include - I'm not using that, and am still having the issue.  I also tried just adding a title to my VF page (title="{!Case.Subject}"), but that has no affect on the browser tab.  

Just wondering if you have any new thoughts on this.  I realize the work-around may be to reproduce the content of my page include in the main page, but it's complex and I use it elsewhere...I'm worried about scalability when I need to edit it.

Thanks for any thoughts you have on this!
Photo of Elissa Bradley

Elissa Bradley

  • 1,938 Points 1k badge 2x thumb
In case anyone is running into this same issue - I finally figured it out.  Key details: 
  • Follow this tutorial, particularly the "Prerequisites" part.  You need to create local copies of three of the VF pages in the Skuid package, or page includes won't display properly. 
  • This part of the VF code - action="{!IF(canUseSkuid,'',redirect)}" - does not reference page assignments, so if you need to render different pages for different situations, you need to add logic to the skuid:page VF component, like this: <skuid:page page="{!IF(Account.Type='Patient','SkuidPatientDetail','')}"