Wss3sdk: how to add content types to websites

Source: Internet
Author: User
You can specify a content type in the website definition so that WSS makes the content types available by default whenever you create a website of this type.

The site definition can be included in a feature.

After creating a website, you can use the WSS object model to add a content type to the website.

Specify content type in site definition

If you want to specify a content type in the site definition, You can first create a separate feature for the content type, and then reference the feature in the site definition.

Steps:

    1. Create a separate feature for the content type.
    2. Reference the website-defined feature:
      1. In the feature defined by the outlet, open the XML file that defines the website.

      2. In the project element, add a reference to the content type feature under the categories and Category elementsSitefeaturesOrWebfeaturesElement. For example:

< Sitefeatures >
< Feature ID = "00bfea71-1c5e-4a24-b310-ba51c3eb7a57"   />
< Feature ID = "695b6570-acdc-4a8e-8545-26ea7fc1d162"   />
</ Sitefeatures >
< Webfeatures >
< Feature ID = "00bfea71-4ea5-48d4-a4ad-7ea5c011abe5"   />
< Feature ID = "00bfea71-e717-4e80-deaf-d0c71b360101"   />
</ Webfeatures >
Add the content type to the created website

You can use the object model to add content types to an existing website.

Steps:

    1. UseAvailablecontenttypesMethod to access all available content types on the website. This method returnsSpcontenttypecollectionObject.
    2. CreateSpcontenttypeClass Object.

    3. UseAddAdd MethodSpcontenttypeObject To the content type set of the website.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.