Home > SharePoint > Create Site Definition in SharePoint2010 Part1

Create Site Definition in SharePoint2010 Part1

Creating Site definition in Visual Studio2010 is very easy; it has a built-in Site Definition Project template. Today I will show you how to create Site Definition using Visual Studio 2010.You can download the complete source code here.

  1. Create Site Definition Project

  2. Choose the Site URL and note that you can only choose Farm Solution the sandboxed solution is greyed out.

  3. After the Visual Studio did his magic, you can see the Project structure as follows, it contains default.aspx which is the default page for that site definition, onet.xml contains the actions for creating site using this site template(This is like the elements.xml in the feature) and webtemp_Ybbest.CustomSiteDef.xml register this Site definition in the SharePoint(This is similar to the Feature.xml in feature)

  4. Open webtemp_Ybbest.CustomSiteDef.xml and modify ID field as it has to be unique and you can optionally choose to modify other fields as well.

  5. Deploy your solution and you can find your site template when you creating your site in either Central admin or Site Creation in Site Actions Menu

  6.     

  7. Create your site collection using your new site template and then navigate to the site you will find the site created by using your site definition.

Categories: SharePoint
  1. No comments yet.
  1. No trackbacks yet.

Leave a comment