template_assignment.xml

This file is optional. If it is present, it takes place in the conf directory of your skin : skins/[skinName]/conf/template_assignment.xml

The purpose of this file is to list the available templates for yours pages. The available templates for assignment is the templates availables in the template menu :

You can add conditions on pages' paths as in samples bellows.

Sample 1

The minimal configuration file : include all templates

<?xml version="1.0" encoding="UTF-8" ?>
<templates>
     <list mode="exclude"/>
 </templates>

Sample 2

In the sample bellow, the available templates for assignment are:

  • the template named "page"
  • the template named "index"
<?xml version="1.0" encoding="UTF-8" ?>
<templates>
     <list mode="include">
         <template name="page"/>
         <template name="index"/>
     </list>
 </templates>

Sample 3

In the sample bellow, the available templates for assignment are:

  • the template named "index"
  • the template named "section" for page of first level
  • the template named "page" for page of second or more level
<?xml version="1.0" encoding="UTF-8" ?>
<templates>
     <list mode="include">
         <template name="index"/>
         <template name="section"/>
         <template name="page"/>
     </list>
     <conditions>
        <condition template="section">
            <page regexp_path="[^/]+"/>
        </condition>
        <condition template="page">
            <page regexp_path="[^/]+/.+" />
        </condition>
     </conditions>
 </templates>

Sample 4

In the sample bellow, all templates are availables for assignment except :

  • the template named "mypage"
  • the templates those name starts with "odf-"

The conditions :

  • the template "index" is available only for pages those path equals to "index"
  • the template "page" is available for pages those path is not equal to "index"
<?xml version="1.0" encoding="UTF-8" ?>
<templates>
     <list mode="exclude">
         <template name="mypage"/>
         <template name="odf-*"/>
     </list>
     <conditions>
        <condition template="index">
            <page regexp_path="index"/>
        </condition>
        <condition template="*">
            <page reverse_regexp_path="index" />
        </condition>
     </conditions>
 </templates>