Content types

Introduction

Plone has two kind of content types subsystems

  • Archetypes based
  • Dexterity based (new)

Flexible architecture allows other kinds of content type subsystems as well.

Plone maintains available content types in portal_types tool.

portal_types is a folderish content where type information are child objects, keyed by portal_type metadata.

portal_factory is a tool responsible for creating the persistent object representing the content.

TypesTool source code.

Creating a new content type

This instructions apply for ::doc::Archetypes subsystem based content types </content/archetypes/>

  • You need to have an add-on product code skeleton created using paster’s archetypes template
  • Use paster addcontent content command new types.

Related how tos

Note

Creating types by hand is not worth of the problems. Please use a code generator to create the skeleton for your new content type.

Warning

Content type name must not contain spaces. Content type name or description must not contain non-ASCII letters. If you need to change these please create a translation catalog which will translate the text to one with spaces or international letters.

Debugging new content type problems

Creating types by hand is not worth of the problems.

Implictly allowed

Implictly allowed is flag whether the content is globally addable or must be specifically enabled for certain folders.

The following example allows creation of Large Plone Folder anywhere at the site (it is disabled by default). For available properties, see TypesTool._advanced_properties.

Example:

portal_types = self.context.portal_types
lpf = portal_types["Large Plone Folder"]
lpf.global_allow = True # This is "Globally allowed" property

Table Of Contents

Previous topic

Renaming objects (changing object ids)

Next topic

Workflows

This Page