Jean Paul's Blog

There are 2 types of People in the World, One who Likes SharePoint and..

  • Microsoft MVP

  • MindCracker MVP

  • CodeProject MVP

  • eBook on SharePoint 2010

  • eBook on Design Patterns

  • eBook on Windows Azure

  • NLayers Framework @ CodePlex

  • MSDN Forums

  • .Net vs. Java

    Due to Public Demand

Create Site Definition with List Instance

Posted by Jean Paul on February 4, 2014

In this article I will take you through a real-world scenario.

1. You need to create a Site Definition

2. When user creates a new site from this Site Definition, a new List Instance too be created

What is the Solution?

We can have multiple solutions for this:

1. Use Feature Stapling

2. Use Event Handler

3. Use Site Definition

I would recommend the third approach as it is the shortest path.


Following are the steps involved for the solution:

1. Create SharePoint Solution Project

2. Create Site Definition

3. Create List Definition

4. Include List in Site Definition

5. Deploy

6. Test

Step 1: Create SharePoint Solution Project

Run Visual Studio 2012 & create a new SharePoint project.


Choose the Farm Solution option as shown below.


Step 2: Create Site Definition

Choose Solution > Add new item > Site Definition


Enter a name for the site definition.

Step 3: Create List Definition

Add a new item > List


Enter a name for the list instance. Choose the option custom and click the Next button of wizard.

(the custom option allows you to create new fields, view fields etc.)


Click the Finish button & in the appearing page enter some unique fields for the list.


Step 5: Include List in Site Definition

Open the onet.xml of Site Definition & Reference the list from it.


You need to use the correct Template Id & Feature Id for it.


For finding feature id, open the Features > Feature 1 > .feature file > Find the GUID against featureId

Step 5: Deploy

Build & Deploy the solution

Now you are ready to test the Site Definition.

Step 6: Test

Open the Browser > Open SharePoint site > Site Contents > New Sub site


After creating the site > Go to Site Contents & you can see the List Instance there.


This concludes our Site Definition with List Instance creation.


A good read for Site Definition vs. Site Templates

· link



In this article we have explored a real-world scenario of Site Definition creation with List Instance. The source code is associated with this article.

Leave a Reply

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

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

Google photo

You are commenting using your Google 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