A quick look at the content type editor in Visual Studio 11

Posted Monday, February 6, 2012 10:52 AM by CoreyRoth

Visual Studio 11 introduces a new content type editor that you might find useful when building your next content type.  It starts with a SharePoint Project Item that you can pick from the New Item menu.

VS11DPContentTypeSPI

From this screen, give your new content type a name and then you’ll be presented with this next screen allowing you to pick a content type to inherit from.  This pulls a list of every content type currently on the site collection that you have your Visual Studio project associated with.

VS11DPContentTypeInherit

Pick the content type you want to inherit from and you will then see the new content type editor.

VS11DPContentTypeEditor1

From here you can begin adding exiting site columns to your new content type.

VS11DPContentTypeEditor2

Selecting one will bring over the type automatically.  Unfortunately the only option you get here is whether the column is required or not.  However, you can click on the elements.xml file in the solution explorer to edit the XML directly.  I’ve tested and it will preserve any additional attributes you add to your site column references there.

VS11ContentTypeEditorXml

You might be wondering what about site columns that have not been created yet.  The editor is actually smart and knows to look at any site columns defined in the same project as well.  For example, I created this new site column below.

VS11DPSiteColumnEditor

Unfortunately, creating site columns still requires XML, but Visual Studio at least gets you started.  After you save your new site column, you will find the site column in the list.

VS11DPContentTypeEditor3

You can also set some of the common properties such as the group and description of the content type itself by clicking on Common Properties

VS11ContentTypeEditorCommon

What about inheriting from your own content type in the same project?  That actually works as well.  However, you will have to look for it at the top of the content type list.

VS11DPContentTypeInherit2

That’s a quick look at what Visual Studio offers for content type editing.  I think the SharePoint Designer still has a few more features, but the main difference is what you create here can actually be deployed elsewhere.  This will work with SharePoint Online as well.  Just use the new publish feature I have talked about earlier.

For more information on Visual Studio 11, go to the Developer Preview site.

Comments

# SharePoint Daily » Blog Archive » SharePoint Predictions For 2012; Getting Started with SharePoint; Windows 8 Tablets Bad for Productivity?

Pingback from  SharePoint Daily  » Blog Archive   » SharePoint Predictions For 2012; Getting Started with SharePoint; Windows 8 Tablets Bad for Productivity?

# SharePoint Predictions For 2012; Getting Started with SharePoint; Windows 8 Tablets Bad for Productivity?

Tuesday, February 7, 2012 8:01 AM by SharePoint Daily

I'm not a big gamer but for some reason I am looking forward to Microsoft Flight . Maybe this time

# SharePoint Predictions For 2012; Getting Started with SharePoint; Windows 8 Tablets Bad for Productivity? – Bamboo Solutions

Pingback from  SharePoint Predictions For 2012; Getting Started with SharePoint; Windows 8 Tablets Bad for Productivity? – Bamboo Solutions

Leave a Comment

(required)
(required)
(optional)
(required)