Skip to main content

 Tutorials

Task-driven tutorials and recipes for PageSeeder

How to create a new document type

Skills requiredXML
Time required (minutes)15
Intended audienceDeveloper
DifficultyEasy
CategoryDocument

Objective

Document types are a key concept in how PageSeeder represents and validates structured text. 

This tutorial shows how to setup a custom document type. It is aimed at developers but could be of interest to analysts or technical writers.

Prerequisites

You must have a role of administrator on the PageSeeder server.

Instructions

Go to the Template configuration page

From to the project dashboard page, click the Config link in the Template box 

Project dashboard – Config option

Or click the Template configuration link from the project menu 

Project menu – Template configuration

Create the document type

Click the Create document type button.

Template configuration page – Create document type

A dialog box opens asking for entry of the name of the document type that is to be created. For the purpose of this tutorial we will call the document type 'movie_information'.

Create document type dialog

Click Create. A new row appears in the table when the dialog closes.

This step creates the /psml/movie_information folder in your project template that contains all the information about that document type.

Create the document template

A document-template.psml file will need to be created next, otherwise the document type will not save. 

Template configuration – Create template

A panel titled document-template.psml opens to right.

Edit the document template

By default, the code editor panel contains with some generic template content, we can use the following content for now: 

<document type="movie_information" level="portable"
          xmlns:t="http://pageseeder.com/psml/template">
  <section id="title">
    <fragment id="1">
      <heading level="1"><t:value name="ps.title"/></heading>
    </fragment>
  </section>
  <section id="content">
     <fragment id="2">
       <para><t:value name="ps.description"/></para>
     </fragment>
  </section>
</document>

Click Save and close the panel with . The document template link for your document type is now ‘edit’.

Template configuration page – Edit template

This step creates the /psml/movie_information/document-template.pxml file with the content you’ve specified. When you create a template, you would usually set the content here.

Check the configuration

You can now create new documents of type ‘movie_information’. Let’s check that the configuration worked. Return to a group within your project and click on the plus button and select the Create document... option.

Plus button – Create document

The ‘movie_information’ is available as an option in the document type drop-down:

Create document dialog – Document type option

Once this has been completed, see next tutorial: How to create a properties fragment.

Created on , last edited on

Available tutorials