Thursday, July 22, 2010

How to create a SharePoint Publishing Page Layout

In many SharePoint based projects, client wants the flexibility to create and maintain pages at runtime following a few particular layouts. SharePoint provides an amazing solution to such kind of client expectations – The Publishing Page Feature. The core concept of the publishing page feature can be explained in 5 points:

1. A Web developer creates and customizes the page layout in Office SharePoint Designer 2007.

2. A content owner creates a new page based upon one of the available page layouts (in the browser).

3. The content owner completes the page in the browser, and then submits it for approval.

4. An authorized approver edits and then approves or rejects the article.

5. Upon approval, the article is published.

Before starting let’s have a look at some of the important terms (Courtesy Office Support Site) which we are going to use throughout this post:

Create a page layout content type

A content type defines how the contributor should enter each type of content, how that content is displayed, and how it is handled in a workflow environment. Content types are added to the top-level site. Thereafter, they are available to all of the sub sites in that site collection. To create or edit content types, you must have authoring permissions on the top-level site. Following are the steps for creating a new content type:

1. In the browser, do one of the following:

• From any team site, on the Site Actions menu, click Site Settings.

• From any portal area, click Site Actions, point to Site Settings, and then click Modify All Site Settings.

2. On the Site Settings page, under Site Collection Administration, click Go to top level site settings.

Alternatively, you can browse directly to http://your_top_level_site/_layouts/settings.aspx.

3. Under Galleries, click Site content types.

4. On the Site Content Type Gallery page, on the menu bar, click Create.

5. In the Name box, type the name for this content type. This name will appear in the Content Types list when we will create the page layout.

6. In the Description box, type a description for this content type.

7. In the Select parent content type from list, click Publishing Content Types.

8. In the Parent Content Type list, click Page.

9. Under Put this site content type into, click Existing group, and then click Page Layout Content Types in the list.

To make your new content type available for page layouts that you create or customize in Office SharePoint Designer 2007, put the content type in the Page Layout Content Types group, where it will be easy to locate. The next section shows you how to use your new content type in Office SharePoint Designer 2007.

10. Click OK.

The Site Content Type page opens.

For a better understanding of Content Type read the following article:

What are content types by Martin Kearn

Create a page layout

1. In Office SharePoint Designer 2007, open the Web site in which you want to create the page layout.

2. On the File menu, point to New, and then click SharePoint Content.

3. In the New dialog box, click SharePoint Publishing.

If this option is not listed, it is probably because the site in which you are working does not have publishing turned on in Office SharePoint Server 2007. If you have authoring permissions on the top-level site, you can turn on publishing for the browser by pointing to Administration on the Office SharePoint Designer Site menu, and then clicking Administration Home. Under Site Administration, click Site features, and then click Activate next to the Office SharePoint Server Publishing option. After you perform these steps, return to Office SharePoint Designer 2007 and start over with step 1, but this time clicks Refresh on the View menu between step 1 and step 2.

4. Click Page Layout.

5. Under Options, in the Content Type Group list, click Page Layout Content Types.

6. In the Content Type Name list, click the content type that you want.

If you created a content type in the previous section, and if you put your content type in the Page Layout Content Types group, you should see that content type in this list.

7. In the URL Name box, type a name for this page layout.

This becomes the file name of the page layout. For example, if you type MyPageLayout in this box, the page layout file name will be MyPageLayout.aspx.

8. In the Title box, type a title for this page layout.

This becomes the page layout title that appears in the list of available page layouts when you create a new publishing page on the Create page in the browser. You want to give the page layout a title that is recognizable to users who create publishing pages that are based on this page layout.

9. Click OK.

The page layout opens in Design view.

The new page layout is created in the top-level site. You can verify that it was created by browsing to the Master Page Gallery at http://your_top_level_site/_catalogs/masterpage/Forms/AllItems.aspx where your_top_level_site is the name of the top-level site. Your new page layout should be listed on this page.

Thursday, July 15, 2010

Steps to follow when upgrading SharePoint 2007 Server Farm from SP1 to SP2

A few days back we started the upgradtion process of one of our clients SharePoint 2007 server farm from Service Pack 1 to Service Pack 2. After studiyng a lot, discussing with Microsoft Support Team, we have summarized the steps and best practices that needed to be followed and they are listed below:

1. FULL SQL Backup for all SharePoint related DBs (from SQL server -> management studio->Databases->backup)

2. Run PREPARETOMOVE stsadm command on all content DB

syntax: stsadm -o preparetomove -contentdb

3. Screenshot of the Central administration site ->content dbs -> with all sites in it.

4. Detach all content DB from WebApp (only the end user web application , not for SSP ,mysite ,search etc)

5. Backup all your customizations (from file system including the custom solutions and web.config files from all the servers in farm)

6. Install WSS x64/86 SP2 Binaries on all servers

7. Install MOSS x64/86 SP2 Binaries on all servers

8. Run the SharePoint Configuration wizard (SCW) on application server that runs the SharePoint Central Admin

9. Run SCW on all other SharePoint server in farm

10. Attach all content DB to respective Web Applications as per the screenshot taken at step 3

11. Logon to Central Admin and check farm version (operations->servers in farm)

Wednesday, July 14, 2010

Free Tool to Copy/Extract dll from GAC

When you are in the middle of the UAT to Production - Solution Deployment Phase, many times you will like to take a back up copy of the assemblies that are all ready deployed and are in GAC for back up purpose.
Yesterday I found a very useful tool - GAC Extractor, it has started saving lot of my command prompt related times to copy Dll's from the GAC. The tool is available for download from the following location:

Click here to download Free GAC Extractor Tool