Then iterate through the collection that is returned by the AvailableContentTypes property of the object. To get a similar list programmatically, create an object to represent the site by instantiating the SPWeb class in server code or the Web class in client code. When the Site Settings page appears, look for the Galleries section, and then click Site content types. You can review a list of the content types that are available to a site by selecting Site Settings in the user interface. For more information, see Content Type Scope. If you add a new content type to a site that is lower down in the hierarchy, it is available in the site where you add it and in any sites below that site in the hierarchy. For example, if you create a site content type at the root site of a site collection, that site content type becomes available on any site in the site hierarchy. When you create a content type and add it to a site's content type collection, the new content type becomes available to any child site and also to the site where it was created. This local instance is called a list content type and applies only to the list onto which it was copied. When you do add a site content type to a list, Microsoft SharePoint Foundation makes a local copy of the site content type and adds the copy to the list. At this point, the content type is available to add to lists and document libraries but has not yet been added. When you create a new content type and add it to a site's collection of content types, it becomes what is known as a site content type. You create and manage content types at the site level.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |