PageType

Creating new PageType

For creating a new PageType called ’MyNewPageType’, the following has to be done:

  • Create the custom View and Edit Templates as Velocity template files if needed in ’webapp/templates/celTemplates’ called ’MyNewPageTypeView.vm’ or ’MyNewPageTypeEdit.vm’ respectively.
  • In the browser, navigate to ’/PageTypes/MyNewPageType
  • Add an object of the class ’Celements2.PageTypeProperties’ to the document which has the following fields:
    • Type Pretty Name: The PageTypes pretty name, e.g. ’MyNewPageType
    • Category
    • Type Edit Template: Set defined Edit Template, e.g. ’Templates.MyNewPageTypeEdit’ or ’NoEdit’ for none
    • Type View Template: Set defined View Template, e.g. ’Templates.MyNewPageTypeView’ or ’NoView’ for none
    • Visible: Yes/No
    • Show Frame: Yes/No
    • Load Richtext Editor: Yes/No
    • Richtext Editor Width
    • Richtext Editor Height
    • Has Page Title: Yes/No
    • Is Unconnected Parent: Yes/No (see Navigation for usage)

Adding PageType to a Document

Adding PageType ’MyNewPageType’ to Document ’MySpace/MyDocument

  • In the browser, navigate to ’/MySpace/MyDocument
  • Add an object of the class ’Celements2.PageType’ to the document which has the following fields:
    • Page Type: Name of the desired PageType, in this example it would be ’MyNewPageType
    • Page Layout

Adding PageType to a Document

Since 2.21.0 it is possible to extend the set of available page-types by implementing the component role IPageTypeProviderRole. The celements page type extension provides the XObjectPageTypeProvider, which supports the standard page type definition by XObjects (as explaint before).