How To Create A Site Definition In Sharepoint 2010

Creating a site definition in SharePoint 2010 is a declarative development task that involves adding Collaborative Application Markup Language (CAML) markup to two critical files: a WebTemp*.xml file and an Onet.xml file. In some cases, custom site pages and resource (.resx) files may also need to be created.

To get started, you will need to set up a Site Definition project in Microsoft Visual Studio. Make sure the project is a farm solution and assign it an internal name that will serve as the site definition’s identifier.

Next, you will need to configure the WebTemp*.xml file. This can be done by changing the ID attribute of the Template element, copying the Configuration element if necessary, and adjusting the attributes for each Configuration element.

The Onet.xml file is another component that can be edited to include additional elements. These may include a custom email footer, a custom file dialog post processor, or a custom document type.

Once the site definition is ready, you can test it by deploying the project and creating a new site based on the custom site definition. This will help ensure that everything is working as intended and any modifications are successfully implemented.

If you need to create a custom site definition, you can do so by making a copy of an existing site definition folder, renaming it, and modifying the corresponding files. This allows you to tailor the site definition to your specific needs while leveraging existing resources.

By following these step-by-step instructions, you can easily create and customize site definitions in SharePoint 2010, empowering you to design and build unique collaborative experiences for your organization.

Testing and Customization of the Site Definition

Once the site definition is created, it is important to test its functionality by deploying the project and creating a new site using the custom site definition. This step ensures that the site definition works as intended and meets the specific requirements of the project.

To deploy the project, navigate to the Site Definition project in Microsoft Visual Studio and build the solution. Once the solution is built, right-click on the project and select “Deploy.” This will deploy the site definition to the SharePoint server.

After the project is deployed, you can create a new site based on the custom site definition. Go to the SharePoint site where you want to create the new site and click on “Site Actions” followed by “New Site.” Choose the custom site definition you created from the available templates and provide the necessary details for the new site.

Custom site definitions can also be created by modifying existing site definition folders. To do this, make a copy of an existing site definition folder, rename it, and modify the corresponding files according to your requirements.

Meet the Author

Abdul Rahim has been working in Information Technology for over two decades. Learn how Abdul got his start as a Tech Blogger , and why he decided to start this Software blog. If you want to send Abdul a quick message, then visit his contact page here.