Sometimes you want to use an existing content type, but with slightly different settings. You might have a client who is technically happy to add a Document to a Folder, but who would rather add Eggs to Baskets. In other words: he wants to use the Document and Folder content types, but with a different name. Also, he might want to put only Eggs in his basket, and not Images and Files. You might be able to do this with zero lines of python code! The trick is that you can use GenericSetup to do your tweaking.
You make a new product: basket. You put that in your Products directory. You add an empty __init__.py. You add a profiles/default directory and register it in configure.zcml:
<configure
   xmlns="http://namespaces.zope.org/genericsetup"
   i18n_domain="genericsetup">
 <registerProfile
     name="default"
     title="Basket profile"
     description="Basket"
     provides="Products.GenericSetup.interfaces.EXTENSION"
     for="Products.CMFPlone.interfaces.IPloneSiteRoot"
     />
</configure>
You add types.xml in profile/default:
<?xml version="1.0"?>
<object name="portal_types" meta_type="Plone Types Tool">
<object name="Basket"
meta_type="Factory-based Type Information with dynamic views"/>
</object>
After this, you copy CMFPlone/profiles/default/types/Folder.xml to profiles/default/types/Basket.xml. Then you change a few lines there . The diff is here:
< <object name="Folder"---> <object name="Basket"5c5<Â <property name="title">Folder</property>--->Â <property name="title">Basket</property>7c7<Â Â Â Â name="description">A folder which can contain other items.</property>--->Â Â Â Â name="description">Basket for Eggs</property>9c9<Â <property name="content_meta_type">ATFolder</property>--->Â <property name="content_meta_type">Basket</property>14,15c14,22<Â <property name="filter_content_types">False</property><Â <property name="allowed_content_types"/>--->Â <property name="filter_content_types">True</property>>Â <property name="allowed_content_types">>Â Â <element value="Egg"/>>Â </property>20,21d26<Â Â <element value="folder_tabular_view"/><Â Â <element value="atct_album_view"/>
Then you restart Zope, go to portal_Setup, in the Properties tab select your profile, in the Import tab select
“Types Tool”, press “Import selected steps” and you are done. Well, we have not looked at how to do this for normal Documents too, adding a content type Eggs based on them, but that should be the same technique, really.
Now create a Basket, add an Egg and enjoy!