2011/02/25

Names of custom content types cannot contain slashes

This is a definition of a custom content type generated in Visual Studio. The only thing I changed is the Name attribute.
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <!-- Parent ContentType: Task (0x0108) -->
  <ContentType ID="0x010800096b8767b29a4191929d5cc2d50e094e"
               Name="Yes/No Task"
               Group="Custom Content Types"
               Description="My Content Type"
               Inherits="TRUE"
               Version="0">
    <FieldRefs>
    </FieldRefs>
  </ContentType>
</Elements>
It seems to be perfectly valid. The package can be built and deployed to SharePoint without any errors or warnings. However, the new content type does not show up on the Site content types page (/_layouts/mngctype.aspx).

The problem is caused by the '/' character in content type's name - remove the slash, re-deploy the package and now the new content type will be visible on the Site content types page.

No comments:

Post a Comment