in

SharePoint Blogs

The Best Place for SharePoint-related Blogs

Tech MOSS Team

PlaceHolderPageTitle is the root of all evil

Recently we have been experiencing some serious problems while working on our newest project. As we needed a customized version of the Publishing Portal template we have made a new version adjusted to our needs. What we needed to do is to reference the customized Master Page and create a default Welcome Page using one of our Page Layouts. And then it's started.

First of all we got some really strange error messages like 'Page contains illegal characters', etc. After stripping the whole Site Definition and having looked at every comma out there I have found something strange was going on with our Page Layouts. At the bottom of each one of them I've found:

<html xmlns:mso="urn:schemas-microsoft-com:office:office"
xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"><head> <META name="WebPartPageExpansion" content="full"> <!--[if gte mso 9]><xml> <mso:CustomDocumentProperties> <mso:PublishingPreviewImage msdt:dt="string"></mso:PublishingPreviewImage> <mso:ContentType msdt:dt="string">Page Layout</mso:ContentType> <mso:MasterPageDescription msdt:dt="string"></mso:MasterPageDescription> <mso:PublishingAssociatedVariations msdt:dt="string">
</mso:PublishingAssociatedVariations> <mso:PublishingHidden msdt:dt="string">0</mso:PublishingHidden> <mso:PublishingAssociatedContentType msdt:dt="string">
;#Agenda item;#0x010100C568DB52D...;#</mso:PublishingAssociatedContentType> </mso:CustomDocumentProperties> </xml><![endif]--> <title>Dummy Content Type</title></head>

Because the deployment using Features didn't work I have tried using the Upload button in the Master Page Gallery. Still the extra piece of code has been added at the bottom of the uploaded Page Layout.

The next thing I've tried was uploading a Page Layout from one of our previous projects. Amazingly this one was ok! After analyzing the content of the Page Layout I've found out that the only difference was the

<asp:Content contentplaceholderid="PlaceHolderPageTitle" runat="server">
    <SharePointWebControls:FieldValue id="PageTitle"
FieldName="Title" runat="server"/> </asp:Content>
At the beginning of the project I've removed this piece of code from the Page Layouts because I've created a custom control writing the complete title string using the current hierarchy. After all the hours spent on this bug I've found that you should never remove the above piece of code - whether you use is or not. It seems that removing it causes SharePoint not to recognize the uploaded Page Layout as a Page Layout what makes it add the selected Content Type reference at the bottom of the file.

Comments

 

SharePoint 2007 Link love: 11-19-2007, part one at Virtual Generations said:

Pingback from  SharePoint 2007 Link love: 11-19-2007, part one at  Virtual Generations

November 19, 2007 3:58 AM
 

SharePoint 2007 Link love: 11-19-2007, part four at Virtual Generations said:

Pingback from  SharePoint 2007 Link love: 11-19-2007, part four at  Virtual Generations

November 19, 2007 8:35 AM
 

Tech MOSS Team said:

Recently while working on an Internet facing web site for one of our customers I thought of creating

January 6, 2008 11:33 AM
 

SHAREPOINTBlogs.com Mirror said:

Recently while working on an Internet facing web site for one of our customers I thought of creating

January 6, 2008 12:21 PM
 

Waldek Mastykarz » Blog Archive » Automatically generating a hierarchical Title in <title> element said:

Pingback from  Waldek Mastykarz  &raquo; Blog Archive   &raquo; Automatically generating a hierarchical Title in &lt;title&gt; element

February 16, 2008 6:06 AM
 

James Tsai's Blog said:

Code blocks are not allowed in this file - SharePoint error with custom page layout

April 4, 2008 7:25 AM
 

if gte mso said:

Pingback from  if gte mso

May 31, 2008 9:15 AM
 

Marco Rizzi - All around Sharepoint said:

During this week I had a problem with page layouts installation via features. In the past, I created...

July 1, 2008 5:56 AM
 

SPSherm.MyBlog said:

I came across this in late 2007, and forgot to blog about it. Just catching up, and wanting to post it

July 27, 2008 1:15 PM

Leave a Comment

(required )  
(optional )
(required )  
Add

About Waldek Mastykarz

Waldek Mastykarz is a Dutch SharePoint 2007 developer specialized in Web Content Management solutions in Microsoft Office SharePoint Server 2007, web standards and accessibility.

Need SharePoint Training? Attend a SharePoint Bootcamp!

Posts (c) their respective authors. Everything else (c) 2007 SharePoint Experts