Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I really need your help.

I've created a new page layout in SharePoint Designer 2010 and I want to apply it to all existing pages in a site. Another thing to note, some subsites and pages use different page layouts. If possible I would like to standardize all page layouts.

I checked online and I found some methods but it seems all of them require the page layout to be "un-customized" and deployed using Visual Studio. I've developed the whole layout in SP Designer and I have no clue how to move it to Visual Studio 2010. Is there any way I can do this using Powershell commands or any other tool?

share|improve this question

3 Answers 3

up vote 3 down vote accepted

Check out this post where this can be achieved through PowerShell - http://jakejacobsen.wordpress.com/2011/04/06/powershell-script-for-updating-page-layouts-in-a-site-collection/

share|improve this answer
    
Thank you for the link. –  Ahmed Jabar Oct 23 '11 at 9:18

Pages are nothing more than an ASPX file. The page layout is in its metadata:

<mso:PublishingPageLayout msdt:dt="string">http://server/site/Library/_catalogs/masterpage/PageLayout.aspx, PageLayout</mso:PublishingPageLayout>

You can try to donwload all of the aspx files and replace the the infomration above.

share|improve this answer
    
Actually I would phrase it as exactly the opposite. Pages are nothing more than metadata, the Layout is the ASPX file. The entry in the Pages library is more or less a stub file. Publishing Pages are closer to Wiki Pages than to actual documents. –  Louis Jan 28 '12 at 3:08

If you want to apply an existing Page Layout to all pages that already exist (and are assigned to other page layouts) you could do this in a C# console application, or PowerShell.

MSDN has an example of doing exactly this in C#.

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.publishing.publishingpage.layout.aspx

The code provided is all you'd need for a static class. In a console application, you'd just need to make sure this code is in a file separate to the Main.cs file, and call into that method.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.