in

Dot Net Mafia

Group site for developer blogs dealing with (usually) .NET, SharePoint 2013, SharePoint 2010, Office 365, SharePoint Online, and other Microsoft products, as well as some discussion of general programming related concepts.

This Blog

Syndication

Archives

Corey Roth [MVP]

A SharePoint MVP bringing you the latest time saving tips for SharePoint 2013, Office 365 / SharePoint Online and Visual Studio 2013.

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

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? said:

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

February 7, 2012 7:55 AM
 

SharePoint Daily said:

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

February 7, 2012 8:01 AM
 

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

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

June 6, 2016 3:10 AM

Leave a Comment

(required)  
(optional)
(required)  
Add

About CoreyRoth

Corey Roth is an independent SharePoint consultant specializing in ECM, Apps, and Search.
2015 dotnetmafia.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems