Miscellaneous Debris

Avner Kashtan's Frustrations and Exultations
Customizing MOSS Page Title

Another odd client request that came in a while ago.

When we browse our Sharepoint site, IE's title reads "Home - My Site Name - Windows Internet Explorer". We can't find any way to remove the "Home" string, regardless of how we change the site's name. This is critical for our ISO review tomorrow!

Now, I'm no ISO reviewer, but it seems a bit excessive even for the strictest ISO test. But hey, I'm just your friendly neighborhood technical solutions provider.

The first step to changing it is to understand where this string is stored. Easiest way to do that is to open the default.aspx page with Sharepoint Designer. We can see it contains a content block that replaces the master page's Title content placeholder.

This is the master page bit (line 14 on my unedited default.master):

<Title ID=onetidTitle><asp:ContentPlaceHolder id=PlaceHolderPageTitle runat="server"/></Title>

And this is the replacement in default.aspx:

<asp:Content ContentPlaceHolderId="PlaceHolderPageTitle" runat="server">
 <SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,multipages_homelink_text%>"
       EncodeMethod="HtmlEncode"/>
-
 
<SharePoint:ProjectProperty Property="Title" runat="server"/>
</asp:Content>

We can see that the title is made up of two parts, the localized "Home" string (in red) and the current site's name (in blue) taken from the site's properties. We have two options here - we can either find the resource string and change it, or remove it from the ASPX altogether (along with the connecting dash) and have a clean page title. The second option is pretty straightforward, so we'll focus on the first:

text="<%$Resources:wss,multipages_homelink_text%>" 

We can see that the actual text is retrieved from some Resource Manager. The format of the $Resources token is as follows:

$Resources:filename,localizedString

So what we need is the string "multipages_homelink_text" under the file wss.resx. Finding it, however, took me a while. I found the file under 12\CONFIG\Resources (under the base 12 folder) rather than the more obvious 12\RESOURCES. This folder contained wss.resx, and also wss.en-US.resx and wss.he-IL.resx, the two languages I had installed. Seemed fitting. Editing the multipages_homelink_text value in them, however, didn't seem to change anything. So I expanded the scope again.

Seems that resx files in the 12 directory are only template files, copied to each specific Virtual Server when its created. From there on, the virtual server has its own copy of the resx files, residing under C:\inetpub\wwwroot\wss\VirtualDirectories\<port>\App_GlobalResources. There I found another copy of the wss.resx file, and changing the value there instantly updated the site, no IISRESET necessary. Joy!

Published Wednesday, April 11, 2007 1:00 PM by Avner Kashtan

Filed under:

Comments

# re: Customizing MOSS Page Title@ Thursday, April 26, 2007 9:23 AM

My moss sites all have a title of default.aspx or similar.  The value is set in the site admin title setting, but is not coming through on the rendered page.  

Any thoughts?

Bob C

# re: Customizing MOSS Page Title@ Monday, April 30, 2007 2:33 PM

The code was not correct in my DefaultLayout.aspx.  This site was based on a beta, so perhaps this was just a vestage from that older WSS v3 build.

It was:

<asp:Content ContentPlaceHolderId="PlaceHolderPageTitle" runat="server"/>

Changed to:

<asp:Content ContentPlaceHolderId="PlaceHolderPageTitle" runat="server">

<SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,multipages_homelink_text%>"

      EncodeMethod="HtmlEncode"/> -

<SharePoint:ProjectProperty Property="Title" runat="server"/>

</asp:Content>

Bob C

# re: Customizing MOSS Page Title@ Monday, April 30, 2007 3:48 PM

This DIDNT fix sub-sites.  Sub sites don't seem to reference the defaultLayout.aspx page mentioned above.

Any ideas?

Bob C

# re: Customizing MOSS Page Title@ Thursday, May 03, 2007 12:16 PM

I fixed the issue by creating a basic Team subsite (which had correct page title logic), and reapplied my template.  If there had been more content, it would have been a bigger issue, but it is working now.

I am wondering how modifying pages (via SPDesigner) will affect this...

Bob C

# Links (4/12/2007) &laquo; Steve Pietrek&#8217;s SharePoint Stuff@ Thursday, May 24, 2007 1:16 PM

Pingback from  Links (4/12/2007) &laquo; Steve Pietrek&#8217;s SharePoint Stuff

Links (4/12/2007) « Steve Pietrek’s SharePoint Stuff

# re: Customizing MOSS Page Title@ Sunday, August 26, 2007 3:53 PM

Hi Avner,

Your post helped me a lot!

Guy Burstein

Guy Burstein

# re: Customizing MOSS Page Title@ Friday, November 02, 2007 6:53 PM

Hello and thanks for documenting this.

I have been trying to understand why every page in a WSS 3 document library that uses the "Basic Page" template is rendered with a fixed title string of "Basic Page", rather than using a title that reflects the page's name.

I've found posts elsewehre with this question but no answers. The problem seem related to your post, so I'd appreciate any light you could shed on this.

Milton Lopez

# re: Customizing MOSS Page Title@ Thursday, November 29, 2007 4:41 PM

Any luck with the "basic page" issue?

Barb Coplen

# re: Customizing MOSS Page Title@ Tuesday, February 19, 2008 5:44 PM

Can anyone tell me that in the uppermost blog...what values we have to change in wss.resx.

Thanks

Rocky

# re: Customizing MOSS Page Title@ Wednesday, April 02, 2008 1:54 AM

I didn't understood how to do this.

can you pls guid me step by step.

I tried it by replace those lines in master pages but it is throwing an error.

Guest

# re: Customizing MOSS Page Title@ Friday, April 11, 2008 3:21 PM

I couldn't get the resource file changes to show up on my pages, so I decided to edit the master page.

If you are editing the master page, the contentPlaceHolder, PlaceHolderPageTitle needs to be in the page somewhere otherwise you get an error on render.

However, this does not mean that you have to keep it as the title.  

1.  Copy the code between the <title> tags.  

2.  Paste the code after the <body> tag and wrap it in a <div> with style="display:none;"

3.  Put your own title where the original code was.

AutoSponge

# re: Customizing MOSS Page Title@ Tuesday, April 22, 2008 1:09 AM

This is a very usefull information. I have been thinking to have two different master pages; 1 with english menus and 2nd with arabic menus. But luckly, this give me a big relax

Karadas

# re: Customizing MOSS Page Title@ Monday, May 26, 2008 9:22 PM

When using sharepoint designer, if you set the page title attribute it doesn't work.

Easy fix would be using javascript as follows..

<script type="text/javascript" >

document.title = 'Some Page Title';

</script>

Balaji

# re: Customizing MOSS Page Title@ Thursday, May 29, 2008 3:07 PM

This works great with Team Sites, but with my Collaboration Portal site, the page title displays "Pages - " in the title, and I cannot find where to edit/remove it.

It is not in the default.aspx like described above.  Can anyone help?

Nick

# re: Customizing MOSS Page Title@ Friday, July 25, 2008 3:25 PM

Standard web part pages are hard coded to use the concatenation of "Document Library Name" - "Web Page File Name" as the Page Title.  The best way to change the title is by changing the Title of the Document Library that stores the page files using the "Document Library Settings".  That changes the first part.  Then change the Name of the Web Page.  That changes the 2nd part of the concatenation.

Jim

# re: Customizing MOSS Page Title@ Monday, September 01, 2008 12:07 PM

Sir/Friends,

I have the same problem. I am trying to remove the title -Home from my default.aspx page which is my Home Page of Personalisation Site Template. Its not getting changed as you said from wss.resx . I want nothing to be displayed on my title area. Can anyone help.

Thanks in advance

Regards,

Suresh

Suresh

# re: Customizing MOSS Page Title@ Tuesday, October 07, 2008 4:14 AM

Jim's post solved my problem.

I copied and customized the default.master page as per suggestion in MS SharePoint Server Help & How-To.

Samuel

# re: Customizing MOSS Page Title@ Wednesday, December 03, 2008 6:04 AM

thnx man, it helped me.

asad ali snadhu

# Customizing MOSS Page Title@ Friday, February 13, 2009 1:44 PM

Great blog no how to change the page title of your site as it appears on your browser ( IE&#39;s title

Irina Alexandris

# re: Customizing MOSS Page Title@ Tuesday, February 17, 2009 2:39 PM

Great Article, this definitely helped me to understand WSS managed resources, however, I'm assuming (maybe incorrectly) that changing this file directly is not a good idea.  for example, a crazy sharepoint patch or hotfix is released that "undoes" the changes to this file, or 2) you call Microsoft for support, they say "I'm sorry, this installation is no longer supported".  Is there a way to create a custom resource file and point your custom.master (that you create from a copy of your default.master and rename) toward?  I would think this would keep the above mentioned pitfalls in check.  I am glad and very excited that you posted this article, it helped me tons!

Thanks,

Matt

Matt Canty

# re: Customizing MOSS Page Title@ Wednesday, April 29, 2009 5:00 PM

Can you tell me how to do this,as I know its possible, just can't remember how. Thanks.

Doug

# re: Customizing MOSS Page Title@ Tuesday, May 12, 2009 4:20 AM

Just found a way (trial and error, so no explanation of why it works!) to change the page title of a Basic Page:

I opened the page in SP Designer and changed line 3 - <SharePoint:encodedliteral runat="server" text="<%$Resources:wss,webpagecreation_bp_title%>" EncodeMethod='HtmlEncode'/>

to read <SharePoint:encodedliteral runat="server" text="My Title :o)" EncodeMethod='HtmlEncode'/>

Works for me... hope it helps.

CC

CustardCrumble

# re: Customizing MOSS Page Title@ Tuesday, June 09, 2009 7:01 AM

Hi,

This seems to work fine with list pages(newform, editform etc...), but with web part pages, the SP designer doesnot save the file, once the above said changes are made in it...Any suggestions...

Thanks and Regards

Shobhit Bhatnagar

# Sharp SEO Tools for Sharepoint | A Point to Share@ Thursday, September 24, 2009 5:17 AM

Pingback from  Sharp SEO Tools for Sharepoint | A Point to Share

Sharp SEO Tools for Sharepoint | A Point to Share

# re: Customizing MOSS Page Title@ Monday, September 28, 2009 11:24 AM

Yes this works great.  In our site the deafult webpage, when created somewhere else and then set to be the homepage, needed to have this code

<asp:Content ContentPlaceHolderId="PlaceHolderPageTitle" runat="server">

<SharePoint:ListProperty Property="Title" runat="server"/> -

<SharePoint:ListItemProperty Property="BaseName" MaxLength=40 runat="server"/>

</asp:Content>

-----------------changed to this code---------

<asp:Content ContentPlaceHolderId="PlaceHolderPageTitle" runat="server">

<SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,multipages_homelink_text%>" EncodeMethod="HtmlEncode"/> -

<SharePoint:ProjectProperty Property="Title" runat="server"/>

</asp:Content>

Michel

# re: Customizing MOSS Page Title@ Friday, October 30, 2009 2:22 AM

Right click file, select properties, change Title

Jenkins

# re: Customizing MOSS Page Title@ Friday, November 13, 2009 3:29 AM

What kind of software will (or do you think) will come out for the iPhone when the software development kit comes out in February? And how will it be transfered to the iPhone? Will there be a software upgrade put out?

________________

<a href=unlockiphone22.com/>unlock iphone 3g 3.1</a>

poori

Leave a Comment

(required) 
(required) 
(optional)
(required)