Skip to main content


Configuration manual for PageSeeder

PSML document template


There is either zero or one document-template.psml file per document type.

The template can specify two types of content and structure: 

  • Common – this is embedded in the template as PSML and appears in every document of that type. For example, a document-type to capture information about football players might require every document to include name, team and position.
  • optional / repeatable – this is PSML wrapped with elements from the template namespace and injected when a new document or fragment is generated. Continuing with the football player document-type, the template might provide for each player profile document to list zero, one or many previous football teams. The profile could also list other playing positions or awards the player might have been nominated for or won. For this optional and / or repeatable content in the player document-type, each document can be unique.

After development and deployment, the end user controls resolving of the optional or repeatable objects through the editing interface.

See the following links for further information on using a document type to improve productivity:

and quality:

When editing a template file in the template file panel, pressing ctrl-space provides context-sensitive, autocomplete options for the template language.

Template namespace

The field and fragment variables in are expressed with t: as wrappers around normal PSML content. No additional development or code is required.

To create a document-template.psml file, use the Document types tab on the Template configuration administration page.

Document-template elements

Document types don’t require a document-template. If document-template.psml is not found in:


any new document for that type is generated using the settings of the default template.



The <t:param> element allows the document to be populated with values generated at the time the document is created. 

If <t:param> is a child of <document>, it appears on the Create Document dialog. If <t:param> is inside a <t:fragment> element, it appears on the Add Fragment dialog. It can have the following attributes:

nameThe parameter name (required)

The title displayed in the user interface (optional).

If not specified, then the parameter is NOT displayed in the user interface unless it is configured under PSMLCreation in the PSML editor config.

defaultThe default value (optional). Not supported for type xml .

The data type - text|integer|date|xml - default is text (optional).

If the value does not match the data type, then the default is used.


Information about the parameter to help users (optional). Requires PageSeeder 5.99 or higher.

When creating new documents, PageSeeder also creates the following parameters:

ps.titleThe title from the user interface or as specified by the <creation> options
ps.filenameThe filename of the document
ps.descriptionThe the description entered in the user interface
ps.authorThe first name and surname of the user creating the document
ps.docidThe document ID from the user interface or as specified by the <creation> options
ps.groupThe current group for the document
ps.pathThe path of the document
ps.currentdateThe current date in ISO8601 format
ps.currentdatetimeThe current datetime in ISO8601 format including timezone information
ps.currenttimeThe current time in ISO8601 format including timezone information
ps.autonumberThe autonumber generated by the document <creation> options if there is one


 The <t:value> element can be used to insert parameter values into the content and can appear inside any element with text content. It has the following attributes.

nameThe parameter name

Inside attributes the value can be inserted using the format {$[name]}.


The <t:fragment> element can be used to define fragment types which can be added by users editing the document. Any defined fragment type can be added inside any <section> in the document unless the section has a @fragmenttype attribute which restricts it to one fragment type. It must appear before any <section> elements and have the following attributes:

typeThe fragment typeyes
titleThe title displayed in the user interfaceyes

It must contain one of the fragment elements: <fragment>, <properties-fragment>, <xref-fragment>, <media-fragment>.


If used, the <t:description> element must be the first element under <t:fragment>. It displays a description of the <t:fragment> when the mouse is over the “add fragment” option. It cannot contain any child elements.

It is recommended that every fragment type have a description.


The <t:fragment-ref> element can be used to insert fragment types. It must appear inside <section> and have the following attributes:

idThe fragment id
typeThe fragment type

For further information, see fragment examples or custom documents.


The attribute t:description can be used on <property> elements and provides information about the property to help users. Requires PageSeeder 5.99 or higher.


Following is an example:

<?xml version="1.0"?>
<document xmlns:t=""

  <t:param name="difficulty" title="Difficulty" type="integer"
           description="1 is the easiest and 5 is the hardest"/>

  <t:fragment type="outcome" title="Outcome">
    <t:description>Adds a learning outcome</t:description>
      <heading level="3">Outcome</heading>
      <para>Type description here</para>

  <t:fragment type="question" title="Question">
    <t:description>Adds a question</t:description>
    <t:param name="question-id" title="Question ID" />
    <t:param name="question-content"
             default="Type content here"/>
      <para>Question ID:
        <inline label="question-id">
          <t:value name="question-id"/>
      <block label="richtext">Content:
        <block label="question-content">
          <t:value name="question-content"/>

      <property name="test-type"
                value="" />
      <property name="test-package"
                multiple="true" />

  <section id="title">
    <fragment id="1">
      <heading level="1">
        <t:value name="ps.title"/>

  <section id="details">
    <properties-fragment id="2">
      <property name="author" value="{$}"/>
      <property name="created"
      <property name="difficulty"
      <property name="topics" multiple="true"
                t:description="The topics for this test"/>

  <section id="outcomes" title="Outcomes" fragmenttype="outcome">
    <t:fragment-ref id="3" type="outcome" />

  <section id="tutorial">
    <fragment id="4">
      <para><t:value name="ps.description"/></para>

  <section id="related">
    <xref-fragment id="5"/>

Created on , last edited on