Posts

Showing posts with the label Site Definition

Adding a custom content type to a site definition

Today we'll be a adding a custom content type to our site definition we created in this post . The project that we're working with is an STSDEV project, so my project file structure reflects that. If you aren't using STSDEV you may need to make a few modifications. If you don't know what custom content types are, here's a good overview . The content type we develop here will extend the Document content type. We'll call it a Project Proposal. Now let's get to work. Step 1: Project Set up Aside from basing this project on the site definiton I created earlier, we'll need to add the Feature folders that reflect the structure on the server. Right click on the TEMPLATE folder in your project and choose 'Add New Folder', name this folder 'FEATURES'. Then add a folder under 'FEATURES' called 'ProjectProposalContentTypes'. Step 2: The feature definition file Since we want to deploy this as a feature we'll need to create the fe...

Deleting sites that were created with errors

This post will have something to do with my next post... When you are creating site definitions and deploying them via a solution, you may successfully deploy them and then find out there is a problem with them upon creation, i.e. you get an error message when creating a site using the definition through the UI. After the error occurs, the site may actually have been created, but does not show up in your navigation bar and the root of the site will be inaccessible. Interestingly enough, you can still get to the site's settings page by going to: http://serverName/siteName/_layouts/settings.aspx You can then delete the broken site from there.

Using STSDEV to create a solution with a Site Definition

In this post I'll give a basic overview of how to create a simple site definition using STSDEV. The purpose of using STSDEV is to give the project a standardized structure and to make use of the solution autogeneration. Here are the steps (Make sure you've downloaded STSDEV and run through the tutorials , or understanding this might be tough) Part 1: Generate the STSDEV solution Open Visual Studio and run STSDEV (should be an option on your tools menu if you ran through the tutorials, see above link) Choose to create an empty solution with C# assembly Click 'Create the Solution' After you create the solution, you'll need to open it from the file system. STSDEV does not automatically open it for you in Visual Studio. Part 2: Set up the project structure Even the most basic site definition needs at least 3 files: a webtemp.xml file, an onet.xml file, and a default.aspx file. So let's create these files in the appropriate places. right click on the 'Root...