This page last changed on Mar 29, 2005 by vidya.

About Templates

Templates are a Confluence feature that allow you to create pages from previously defined forms. Templates are useful for giving your Confluence pages a 'house style', especially for types of pages that are commonly created. For example, a software development project might have templates for use-cases, or a systems administration space might make a template defining what information is being kept about each server.

Templates are written in Confluence's regular wiki markup, using special markup to define form fields that need to be filled in.

Using Templates

When you create a page, you may see a link asking you to select a template page:

If you do not see this link, then there are currently no templates defined - an administrator will have to create one before you can use it.

Following this link will present you with a list of the templates that are available in the current space.

Once you have selected a template, you will be asked to fill it in: enter the appropriate values into the form and press the "Insert Variables" button:

Once you've inserted the variables into the template, you'll have one last chance to edit the page as a whole to clean up anything messy (or add more information) before saving it.

Creating Templates

There are two kinds of templates. Global Templates are defined by the site administrators from the global administration pages, and are available in every space. Space Templates are defined by space administrators in the space administration screens, and are only available in the space in which they are defined.

Either way, templates are just regular wiki pages with special markup to tell Confluence where to insert form fields. There are three kinds of form fields supported: text input, text areas and drop-down menus. Every input field must have a unique name, which is just a word that will .

Text input fields are special. If you have more than one text input field in the same template with the same name, then Confluence will make sure that they all end up with the same value: this is useful if you need the same information in more than one place in the page!

Template input markup

@VAR@
Creates a text input field for a variable called VAR
@VAR|textarea(5x10)@
Creates a 5 x 10 text-area for a variable called VAR
@VAR|list(one,two,three,four)@
Creates a drop-down box containing the values "one", "two", "three" and "four"

Important There must be no spaces between the @-signs in the markup. This means you can't have items in your drop-down lists that contain spaces:

Good
@VAR|textarea(10x80)@
@VAR|list(red,blue,green,orange)@
Bad
@VAR|textarea(10 x 80)@
@VAR|list(red, blue, green, orange)@
@VAR|list(red,blue,light green,orange)@

Template Limitations

Templates can only be used to create a page. Once a page is created, the template is gone and all further editing is performed as if the template had never been used.

In the future, templates will be expanded to do more interesting things - such as remaining part of the page, having more complex (and even dynamic) fields, being able to search Confluence based on the value of particular fields, and so on.


choose-template.png (image/png)
select-template.png (image/png)
insert-variables.png (image/png)
Document generated by Confluence on Dec 20, 2007 18:51