Configuration manual for PageSeeder

PSML document template


There is either zero or one document-template.psml file per document type. This file specifies the following classes of content and structure: 

  • common – this is normal PSML content that exist in identical form in every document of the type. 
  • optional / repeatable – variables or PSML content that has been defined in the template namespace and processed when a new document is spawned or during editing.  Within the constraints of the document template, this content may be different in every document.

See the following links for further information on using the document type to improve productivity (custom editors, document display) and quality (document names and locations, data validation). 


When editing this template file in PageSeeder pressing ctrl-space will display autocomplete options to make editing easier.

Template Namespace

The field and fragment variables in (expressed with t:) are as follows:

  • <t:param> – used to declare and label a parameter plus optional characteristics.  These can be prompts to users for input when the document or fragment is created, or they can be system values such as the date and time of creation.
  • <t:value> – injects the parameter value into the document content as the value of an attribute or element.
  • <t:fragment> – declares a PSML <fragment> that can be invoked zero or many times by the user editing the document.
  • <t:description> – is the description for the <t:fragment> which appears when the user is editing the document and mouses over the add fragment options.
  • <t:fragment-ref> – refers to the <fragment> by @type, it is only valid inside a <section> element.

No additional code is required to integrate the document-template.psml. Simply declaring the objects correctly will make them part of the PageSeeder document lifecycle, including editing, search and publishing.

To create a document-template.psml file, use the Document Types page located under the Dev tab in the Developer perspective.

Document-template elements

Document types do not require a document-template. If document-template.psml is not found in:


any new document for that type will be 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 will appear on the New Document page. If <t:param> is inside a <t:fragment> element it will appear on the Add Fragment dialog. It can have the following attributes:

nameThe parameter name (required)
titleThe title displayed in the user interface (optional).
If not specified then the parameter will NOT be displayed in the user interface.
defaultThe default value (optional)

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.

When creating new documents PageSeeder will also create 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


 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 should appear before any <section> elements and have the following attributes:

typeThe fragment type
titleThe title displayed in the user interface

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


The <t:description> element can only be the first element under <t:fragment>. It defines the description for the fragment type which appears when the user is editing the document and mouses over the add fragment options. 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.


Below is an example:

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

  <t:param name="difficulty"
           type="integer" />

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

   <t:fragment type="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"/>

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

  <section id="metadata">
    <properties-fragment id="2">
      <property name="author"
      <property name="created"
      <property name="difficulty"
      <property name="topics"

  <section id="outcomes"
    <title>Learning Outcomes</title>
    <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