Table of contents
TOC
Collapse the table of content
Expand the table of content

FieldAndContentTypeExtensions.GetContentTypeByName Method

SharePoint Dev Documents|Last Updated: 5/20/2017
|
1 Contributor

Return content type by name

Namespace:Microsoft.SharePoint.Client
Assembly: OfficeDevPnP.Core.dll

Syntax

public static ContentType GetContentTypeByName(this Web web, String contentTypeName, Boolean searchInSiteHierarchy = False)

Parameters

web

  Type: Microsoft.SharePoint.Client.Web
  Web to be processed

contentTypeName

  Type: System.String
  Name of the content type

(optional) searchInSiteHierarchy

  Type: System.Boolean
  Searches accross all content types in the site up to the root site

Return Value

Type: ContentType
Content type object or null if was not found

See also

© 2018 Microsoft