[Product-Developers] Create new plone.app.page type

Martin Aspeli optilude+lists at gmail.com
Thu Jul 21 18:13:12 UTC 2011


On 21 July 2011 13:17, Maarten Kling <maarten at fourdigits.nl> wrote:
> lets try again :)
> I like to create a new type called Person for use in deco, based on the Page
> type.
>
> There is a way of doing this by hand:
> http://localhost:8080/Plone/@@deco-controlpanel#fieldsetlegend-page-types
> - click Add
> http://localhost:8080/Plone/@@add-page-type?form.button.AddPageType=Add
> - name it Person
> Looking at: http://localhost:8080/Plone/dexterity-types
> There are now 2 types, one called Page, and the second called Person.
>
> When i add a field to the Person type:
> http://localhost:8080/Plone/dexterity-types/person/@@add-field
> It is also added to the Page type and that is something i don't want.
>
> When i create a new type in code i'm not able to inherit it from the
> Page(FTI) type.
> Module plone.app.page.content, line 34, in setDefaultLayoutForNewPage
> ValueError: Cannot find layout template for person

If you're doing this on the filesystem, I would:

 - Create a new schema that derives from IPage and has your new field(s)
 - Copy the FTI XML for the 'person' type you created in the steps above
 - Change the reference to the IPage schema to be your new IPerson schema

Martin


More information about the Product-Developers mailing list