Create Site Definition in SharePoint2010 Part1

Posted by ybbest on YBBest See other posts from YBBest or by ybbest
Published on Sun, 09 Oct 2011 10:14:38 +0000 Indexed on 2011/11/11 18:30 UTC
Read the original article Hit count: 408

Filed under:

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.


© YBBest or respective owner

Related posts about sharepoint