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 an PSML <fragment> that can invoked zero or many times by the user editing the document.
  • <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: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" title="Difficulty" type="integer" />

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

   <t:fragment type="question">
        <t:param name="question-id" title="Question ID" />
        <t:param name="question-content" title="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"   value="{$}"/>
      <property name="created"  value="{$ps.currentdate}"
      <property name="difficulty" value="{$difficulty}"/>
      <property name="topics"   count="n"/>

  <section id="outcomes" fragmenttypes="outcome">
    <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