How can I make customized content types?
Up to Table of ContentsThis FAQ applies to: Plone 2.5.x, Plone 2.1.x, Plone 2.0.x
There are several different ways to make customized content types, depending on the amount of specialization you want:
- to have a content type that holds the same information as an existing type, but looks different
- You don't have to create a new class of objects at all. Instead, you can create a new Portal Type on your existing types. Under portal_types, just copy and paste an existing type (for example, copy "News Item", paste it, and rename it "Press Release"). Now you can modify the existing skins, as needed.
- to create a new content type
- the easiest way to create an entirely new type is to use Archetypes, an add-on to Plone 2.0 and an integral part of Plone 2.1. This lets you define a simple schema file. It is much more flexible than the first two options if your new type needs to have many new attributes, behaviors, etc.; however, it will involve installing a new product, having filesystem access to your Plone server, and restarting the Plone server. For some pointers, see the documentation overview. In particular, you may want to check out the ArchGenXML CASE tool, which lets you create content types using UML diagrams. The ArchGenXML tutorial should get you started.
- to have a content type that holds similar information to existing types
- You can base your new type on an existing type, but add new properties onto it. To do this, under portal_types, choose a Scriptable Type Information' type. You'll need to read documentation on how to use Scriptable Type Information, but this will let you define a custom creation script that can add any new desired attributes. Then, you can modify the scripts. For more advanced use cases, you may want to extend an Archetypes content type. The RichDocument tutorial shows you how to extend Plone 2.1's default content types.
- (deprecated) use a ZClass
- ZClasses were through-the-web, easy-to-use tool for creating new content types. Unfortunately, they have enough limitations that many people recommend not using them at all. If you're interested in ZClasses, you can read about them in the Zope Book