In a document library, once you have enabled content type management and added content types to the library, these content types are visible for the users in 3 places:
- on the New toolbar menu,
- when uploading a document
- when editing a document’s properties
I was recently asked to tweak the visibility of content types in these 3 places, e.g. hide a content type from the New toolbar menu, but make it available for selection when uploading or editing a document’s properties.
There are 2 properties in SharePoint that affect the visibility of content types in these 3 places. (Well actually just 2 places – as the list of content types when uploading and when editing properties is the same – they are actually the same page). These are:
- Visible on New Button (can be set through the UI – List’s Settings – screenshot below)
- The Hidden property of the SPContentType object (can be set only through the object model)
The Visible on New Button (VNB) setting controls whether the content type appears on both the New AND Upload/Edit menu.
The Hidden property controls whether the content type appears on the New menu. It does not affect whether the content type appears on the Upload/Edit menu.
SharePoint does a logical AND operation on the 2 settings above to determine whether to show the content type. The table below explains this:
|Visible on New Button is TRUE||Hidden is TRUE||Content type is ONLY visible on Upload/Edit properties|
|Visible on New Button is TRUE||Hidden is FALSE||Content type is visible on BOTH New menu and Upload/Edit properties|
|Visible on New Button is FALSE||Hidden is TRUE||Content type is hidden on BOTH New menu and Upload/Edit properties|
|Visible on New Button is FALSE||Hidden is FALSE||Content type is hidden on BOTH New menu and Upload/Edit properties|
There is another twist: for a document library, if a content type is visible, but it’s document template is blank – you will get an option to upload, rather than to create new, under the New menu (as shown below).