MsAdvisor

All Things MS Learned & Utilized

Implementing Site Templates on SharePoint 2010

You may or may not know is that the Site Template (STP) is gone however there are some new activation procedures you should know about when implementing the new WSP Site Templates.

Real-Time Use – This allow you to upload and select a template during Site Collection creation time.

Site Collection Installation and Activation/Deactivation – This allows any site created within the Site collection to use a custom template.

Server Installation and Activation – This allows a template to be installed on the server and then activated as needed within a Site Collection.

Real-Time Use

In 2007 when you wanted to create a new Site Collection with a template, the site template needed to be installed globally before it could be utilized. That is not the case in SharePoint 2010. In 2010 you can choose to load a site template at Site Collection creation time. Take a look at how below.

This pertains to the creation of a new site collection, so you will need to execute whatever process you normally follow to make that happen.

I will focus on the process of using “Self Service Site Creation”.

When you enter the Self Service Site Creation create site collection page, you will focus your attention on the “Template Selection” group.

First click on the “Custom” tab, indicated in green below. Next make sure “Select Template Later” is chosen, then choose “Create” to create the site collection.

image 

From here on out, anytime you go to the Site Collection, it will present you with the template selection screen.

image 

See the “Solution Gallery” at the bottom? Click on it.

image 

Now that we are in the Solution Gallery, welcome, we need to add the solution that we want to use. Click on the “Solutions” tab. Yes I know, it looks like it is already clicked, but click on it again for me.

image

Click on “Upload Solution”

image 

Choose your solution (WSP) and upload.

image 

WAIT DON’T CLICK “CLOSE”

Please click “Activate” to active the WSP so that it can be used to create a site.

image 

You see the template is a feature and the feature needs to be activated. However in the case of the Solution you must do so from the Solution Management dialog.

Now click “Browse” and then the link for your new Site Collection.

image 

This will return you to the Template selection page. Now click on the “Custom” tab again. However notice this time your site template is available to be chosen. Click it and create your site.

image

 

Site Collection Installation & Activation/Deactivation

What if you want to make the site template automatically available to all sites within a Site Collection. Those steps are simple, let’s go through them now.

Click on Site Settings in the Site Actions navigation drop down.

image 

If you are not at the top level site collection, click on “Site Collection Administration” to get there.

image 

Click on “Solutions”

image 

Now that we are in the Solution Gallery, welcome, we need to add the solution that we want to use. Click on the “Solutions” tab. Yes I know, it looks like it is already clicked, but click on it again for me.

image

Click on “Upload Solution”

image 

Choose your solution (WSP) and upload.

image 

WAIT DON’T CLICK “CLOSE”

Please click “Activate” to active the WSP so that it can be used to create a site.

image 

You see the template is a feature and the feature needs to be activated. However in the case of the Solution you must do so from the Solution Management dialog.

If you forgot to activate the Solution, return to the Solution Gallery and hover over the Solution and choose “Activate”.

image 

Return to the previous step once in the “Solution Gallery – Activate Solution” dialog.

You are now ready to create site with this template. Unlike in the Real-Time Use implementation above, you can choose this template from the “New Site” Silverlight object creation wizard.

image 

Once a solution has been activated in order to delete the solution you must first deactivate the solution. Any site currently created with the solution will continue to function if the solution has been deactivated, you just won’t be able to create any new sites with it.

You can deactivate a solution by entering the Solution Gallery, hovering over the solution, and choosing “Deactivate”.

image 

Now click on the Deactivate button in the Dialog.

image 

To delete the solution, hover over the solution and choose “Delete”.

image 

 

Server Installation & Activation

What if you want to make a site collection available to all sites on the server, how can you do that with the new WSPs?

To do that you will need to use the “stsadm –o addsolution” command or the “Add-SPSolution <SolutionLocation/SolutionName>.wsp” powershell script.

Here are the steps to make a Site Template globally available.

First, are you a server admin? If not then these steps are not for you. If you are then here you go.

Open the “SharePoint 2010 Management Shell”

image 

Place the WSP on your server to be added to the Farm Solutions Gallery.

Type “Add-SPSolution”

image 

For LiteralPath, you are going to following these steps.

Locate your physical WSP file to be installed. Hold down your Left Shift key and right mouse click on the file to be installed. Choose “Copy as path”.

image 

Back in your Management Shell, right mouse click and choose paste. You’ll notice that it pastes with quotes, not good. You’ll need to remove those. Delete the quotes from around the path and click enter.

image 

Next you need to deploy the solution so that it can be activated in any site that wants to use it for it’s site collection.

Enter SharePoint Central Administration

image 

Click on “System Settings”

image 

Click on “Manage Farm Solutions”

image 

Click on the Solution you want to deploy.

image 

Click “Deploy Solution”

image 

Click the “OK” button

image 

User Solutions created are Global WSPs by default. As such you cannot specify a specific Web Application that you want to deploy to.

After you click OK your solution will be deployed and can now be used within any Site Collection within any Web Application. It isn’t that simple though, now we need to activate the Solution in the Site Collection where we want to use it.

IMPORTANT!!! – A deployed solution can be used for the top level of a site collection without having to upload it again. You can accomplish this by, choosing the option of Custom/Select Template Later when creating your site collection, and when the Template Selection page comes up, follow the same steps shown below. After following the steps, just return back to the URL of your Site Collection and choose the template you just activated. This is very simple to the Real-Time Use steps above, however you do not need to upload the solution again.

Activate Via the Site Collection Features

Now we are ready to activate our template inside of the Site Collection where we want to use it. Click on Site Settings in the Site Actions navigation drop down.

image 

If you are not at the top level site collection, click on “Site Collection Administration” to get there.

image 

Click on “Site Collection Features”

image 

Click the “Activate” button next to the “Web Template feature of exported web template…” solution you want to be able to use for sites created in the Site Collection.

image 

You are now ready to create a site with this template. Unlike in the Real-Time Use implementation above, you can choose this template from the “New Site” Silverlight object creation wizard.

image

Advertisement

February 5, 2010 - Posted by | Uncategorized

3 Comments »

  1. Hi,

    Is there anyway that I can change the feature name and do all the above said process through ststadm commands.

    Comment by Uday | May 17, 2011 | Reply

  2. Is it possible to create a site from the created custom template using the new-spsite powershell command.

    after following your steps and then running the get-spwebtemplate command I don’t see any reference to my custom template in the returned list.

    cheers,

    Colm

    Comment by Counie | July 14, 2011 | Reply

  3. This was very useful. Thanks for explaining in detailed way…

    Comment by Amar | January 27, 2012 | Reply


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.