A few months ago I recorded a video for TechNet on Using Content Types in SharePoint 2007. This video focused on the end-user experience, creating site columns and content types using the browser. This week a colleague of mine, who is fairly new to SharePoint development, was tasked with building a Feature that would create a couple content types when activated. He wasn’t really sure where to start so I sat down with him to walk through the process I use.
Here are the steps in a nutshell:
- Prototype out the content types using the browser.
- Create a Visual Studio project with a feature and two element manifests. One for the site columns and one for content types.
- Use SharePoint Manager (a free utility from CodePlex) to extract the CAML that defines the site columns and it to your Visual Studio project
- Add the CAML for the content type, getting the ID from SharePoint Manager and adding the FieldRefs for the site columns that make up the type
Once you’ve gone through the process once, it’s pretty easy to repeat. Check out this video for an end-to-end walkthrough.
Watch the video on Vimeo.
Technorati Tags:
SharePoint