Thursday, February 20, 2014

Create SharePoint 2013 Custom Content Type using Visual Studio


Add a Content Type Item in the SharePoint Project
















<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <!-- Parent ContentType: Contact (0x0106) -->
  <ContentType ID="0x0106008E38D5B2B38B4417A0B35663615FAEF7" Name="RetailContact_Decl" Group="Custom Content Types" Description="My Content Type" Inherits="TRUE" Version="0">
    <FieldRefs>
      <FieldRef ID="{F55DE332-074E-4e71-A71A-B90ABFAD51AE}" DisplayName="$Resources:core,Assistants_Phone_OL;" Name="AssistantNumber" Sealed="TRUE" />
      <FieldRef ID="{7546ad0d-6c33-4501-b470-fb3003ca14ba}" DisplayName="$Resources:cmscore,column_contactname_displayname;" Required="FALSE" Description="$Resources:cmscore,column_contactname_description;" Name="PublishingContactName" Sealed="TRUE" />
    </FieldRefs>
  </ContentType>
</Elements>





Specify Parent Content type



















Add new columns as required










Deploy the solution








The feature should be automatically activated.. You should be able to see your Content Type in the target Site Collection




















No comments: