How to create a new document type
Skills required | XML |
---|---|
Time required (minutes) | 15 |
Intended audience | Developer |
Difficulty | Easy |
Category | Document |
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
Or click the Template configuration link from the project menu
Create the document type
Click the Create document type button.
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'.
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.
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
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.
The ‘movie_information’ is available as an option in the document type drop-down:
Once this has been completed, see next tutorial: How to create a properties fragment.