Welcome to my blog on all things SharePoint. I have a range of articles that will interest you if you've made it as far as visiting my blog. I was awarded as an SharePoint MVP by Microsoft in July 2010. I currently live in New York and am an Enterprise Architect at AvePoint Inc.. I co founded www.NothingButSharePoint.com with Mark Miller in 2010.

MVP AwardJeremy Thake Profile Photo

Whitepapers

NBSP

Check out my articles on NothingButSharePoint.com

Solution Development in SharePoint 2007

This series was inspired by the chatter amongst SharePoint blogs on the best ways to approach customisations in SharePoint using Solutions.

Part 1 - Part 2 - Part 3 - Part 4 - Part 5 - Part 6 - Part 7 - Part 8

Leveraging the SharePoint Platform

This series was inspired by a discussion had with Andrew Coates at a Perth SharePoint User Group meeting. This then turned into a 6 part series on Arno Nell's SharePointMagazine.net web site.

Initial post - Part 1 - Part 2 - Part 3 - Part 4 - Part 5 - Part 6

Webcasts

I have recorded various web casts that I present at User Groups or just on a specific topic by request:
How ASP.NET Developers can leverage SharePoint webcast
SPSource Webcast: Reverse engineer Lists to ListTemplates and much more
SharePoint Development with Unit Testing webcast
Perth SharePoint UG Web Cast on approaches to deploying artefacts (SPSource)
More...


Podcasts

I have been interviewed about Leveraging the SharePoint Platform by the SharePoint Pod Show: listen here .

RSS Feed Feed your read!

Archives

January 2012 (5)
September 2011 (2)
August 2011 (1)
July 2011 (3)
June 2011 (7)
May 2011 (3)
April 2011 (3)
March 2011 (3)
February 2011 (2)
January 2011 (1)
December 2010 (4)
September 2010 (4)
July 2010 (5)
June 2010 (4)
May 2010 (6)
April 2010 (7)
March 2010 (5)
February 2010 (7)
January 2010 (3)
December 2009 (1)
November 2009 (6)
October 2009 (9)
September 2009 (7)
August 2009 (6)
July 2009 (13)
June 2009 (4)
May 2009 (12)
April 2009 (4)
March 2009 (4)
February 2009 (13)
January 2009 (4)
December 2008 (4)
November 2008 (11)
October 2008 (16)
September 2008 (4)
August 2008 (5)
July 2008 (4)
June 2008 (8)
May 2008 (5)
April 2008 (9)
March 2008 (5)
February 2008 (6)
January 2008 (1)
November 2007 (11)
October 2007 (8)
September 2007 (24)
August 2007 (5)
July 2007 (2)
May 2007 (1)
April 2007 (1)
March 2007 (1)
February 2007 (3)
January 2007 (4)
November 2006 (7)
October 2006 (7)
September 2006 (18)
August 2006 (14)
June 2006 (3)
May 2006 (8)
April 2006 (4)
March 2006 (38)
February 2006 (30)
January 2006 (2)
December 2005 (3)
November 2005 (28)
May 2005 (1)
April 2005 (5)
March 2005 (1)
November 2004 (1)
August 2004 (11)
July 2004 (1)
Failed to render control: An error occurred during a call to extension function 'createMonthUrl'. See InnerException for a complete description of the error.

Links

Tag Cloud

Ajax, Apple, DotNetNuke, Enterprise Content Management, Error Resolution, Gadgets, General, Governance, Microsoft .Net Development, Mobile, SharePoint, Sharepoint Business Forms, Sharepoint Business Intelligence, Sharepoint Collaboration, SharePoint Development, Sharepoint Enterprise Content Management, Sharepoint Enterprise Search, Sharepoint Portal, US Migration, Web 2.0, Workflow

Approved Page Layouts not showing in PublishingWeb   

Tags: SharePoint, Governance
Technorati Tags: ,

Had a "great" morning this morning involving releasing to our SharePoint 2007 Production environment which has been in place for nearly 18 months now - 6 server farm. Our UAT environment was built by myself last month which "matches" Production as closely as possible in terms servers etc. but it's been hard because the documentation of how Production built is incomplete. So far anyone out there who has built an environment, I would strongly recommend documenting ANY configuration change made to that Farm environment.

Anyway, I released to our Shared Dev environment fine and dandy and also to our UAT environment with no problems. Then I came across an error in Production, fortunately I had enough exception handling in there to throw and error when I called GetAvailablePageLayouts in the EventReceiver that was trying to create the page and didn't get back the Page Layout I expected in this collection!

$pubweb.GetAvailablePageLayouts() | ft Name, Title

Name Title

---- -----

ArticleLinks.aspx Article page with summary links

RedirectPageLayout.aspx Redirect Page

DefaultCPMiningLayout.aspx Default CP Mining Page Layout

Much digging around the web pointed me towards looking at SPWeb.AllProperties["__PageLayouts"] which in a default environment isn't even there but can also be string.Empty. In my Production environment it included a bunch of XML.

PS C:\Deployment> $web.AllProperties["__PageLayouts"]

<pagelayouts><layout guid="794ff91c-4d30-4d17-a342-bb39218a52a9" url="_catalogs/masterpage/ArticleLinks.aspx" /><layout

guid="bbcc0e4b-8b9f-45af-8383-9c2b63342e41" url="_catalogs/masterpage/RedirectPageLayout.aspx" /><layout guid="ff8de27

d-5ff6-4908-bf8c-520fc82bfc80" url="_catalogs/masterpage/DefaultCPMiningLayout.aspx" /></pagelayouts>

So, then started looking around at how this is set on the web and came across SetAvailablePageLayouts. But reading around it wasn't obvious how you got the PageLayout objects to put in the PageLayouts[] array parameter of the method. And Google said nothing on this :-(

I then dug some more and found this property on PublishingWeb called AllowAllPageLayouts , so I set that...and nothing seemed to happen! Then I noticed there is a Update() method also! So the key here is to call both in order ;-)

$baseURL = "http://intranet"
$web = global:Get-SPWeb($baseURL, $null)
$pubweb = [Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb($web)
$pubweb.AllowAllPageLayouts($true)
$pubweb.Update()
$pubweb.GetAvailablePageLayouts() | ft Name, Title

And here were the results! Phew!

PS C:\Deployment> $pubweb.GetAvailablePageLayouts() | ft NAme,Title

Name Title

---- -----

PageFromDocLayout.aspx Article page with body only

ArticleLeft.aspx Article page with image on left

ArticleRight.aspx Article page with image on right

ArticleLinks.aspx Article page with summary links

RedirectPageLayout.aspx Redirect Page

BlankWebPartPage.aspx Blank Web Part Page

DefaultCPMiningLayout.aspx Default CP Mining Page Layout

DocumentWebPartPage.aspx Document Web Part Page

WelcomeLinks.aspx Welcome page with summary links

WelcomeTOC.aspx Welcome page with table of contents

WelcomeSplash.aspx Welcome splash page

There was no documentation on this being locked down at the Site Collection RootWeb, these kind of changes can cause all sorts of issues when you're not expecting them! So again, I recommend documenting anything that is different from a base install when it comes to configuration, or at least have a Solution package that can configure it in a new environment.

I guess the big point is how far do you go with documenting and scripting configuration? The whole point of SharePoint is to be collaborative and let it evolve naturally. Realistically not every dev environment is going to have enough room to restore a entire Site Collection into it, so the rule of thumb is everything but the content should be re-deployable in your Dev / UAT environment. Where the line is drawn between Configuration and Content is left to discuss another day...

 
Posted by  Jeremy Thake  on  6/11/2008
2  Comments  |  Trackback Url  | 0  Links to this post | Bookmark this post with:        
 

Links to this post

Comments


Sezai  commented on  Sunday, June 15, 2008  7:08 PM 
You can configure this in site settings. Click the "Page Layouts and Site templates" link under Look and Feel.

Links to this page -
/_Layouts/AreaTemplateSettings.aspx


  commented on  Friday, January 23, 2009  10:46 AM 

blog comments powered by Disqus