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
|
Creates a text input field for a variable called VAR |
|
Creates a 5 x 10 text-area for a variable called VAR |
|
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
|
 | Bad
|
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.
Can a template be made the default for a space such that when a user clicks "Add Page" they are brought to the template automatically?

Posted by pwolpe at Apr 07, 2005 18:06
|
Can the Home page for a space be driven by a template when the space is created?

Posted by stuart@leadiant.com at Apr 21, 2005 08:19
|
I cannot see/find Space Templates in the space administration screens. Where do I find it? I am currently using 1.3.5 trial version.

Posted by mclai at May 17, 2005 16:55
|
The textarea() description above isn't correct. I discovered that (5x10) doesn't do anything, but (5,10) does. Looks like the x should be a comma (either that, or the code is wrong ). I'm using confluence 1.4.1, build 212.

Posted by yoderm at Jun 10, 2005 13:29
|
It would be nice if you could set a template to produce pages with a preset parent (I'm trying to set up a simple bulletin board: items for sale, etc., and the items should all have the same parent)
Also, if the new page title could be gathered on the same page as the form, there would be fewer steps to create a page via template.

Posted by at Jul 07, 2005 10:53
|
How do you insert prest content into variable?

Posted by at Aug 16, 2005 16:05
|
I am also trying to work this out at the moment. Have you had any response yet?

Posted by at Sep 29, 2005 05:41
|
Not a peep.

Posted by at Sep 29, 2005 07:03
|
I'm afraid that Confluence does not offer this feature. The request is being tracked here (CONF-3697). If you like, you can vote for the feature to be added.

Posted by jnolen at Sep 29, 2005 11:26
|
If you can't specify a default template for the area, is it possible to specify a template for a particular button/link?
I imagine its just a case of converting the POST request into a GET and seeing what the parameters are.

Posted by mrjcleaver at Apr 03, 2006 12:43
|
http://www.example.com/pages/createpage-entervariables.action?spaceKey=FALLSLIBRARY&parentPageString=&fromPageId=0&title=&linkCreation=false&templateId=1
works.
But this is messy and fragile as I now have an external link to my own site.

Posted by mrjcleaver at Apr 03, 2006 13:06
|
http://confluence.atlassian.com/display/CONFEXT/Decorators has a similar link pointing to http://confluence.atlassian.com/pages/createpage.action?spaceKey=CONFEXT&fromPageId=8644&templateId=18 - except the template seems to be being ignored

Posted by mrjcleaver at Apr 03, 2006 13:10
|
You can use the {add-page} or {link-page} macros which come with the Linking Plugin. It will generate a link similar to that which Martin suggested, except without the messy fragileness. Eg:
Hope that helps.

Posted by david@randombits.org at Apr 03, 2006 18:10
|
Thanks David,
This is helpful except I am now trying to put this into a lozenge:
{add-page:template=Library Content|parent=@self|label=zyx}Add a new child page{add-page}
Can I put the add-page inside the link= parameter?
Can I put a default label on the page?

Posted by mrjcleaver at Apr 04, 2006 15:33
|
You can't put the add-page inside a lozenge, but you should be able to put the lozenge inside an add-page 

Posted by gfraser at Apr 04, 2006 16:01
|
By which Guy means something like this (for clarity):
There is no 'label=zyx' option at this point, and it won't happen unless Atlassian changes their page-creation process to allow label setting within it, unfortunately. Well, that or I rewrite their code within my own plugin...

Posted by david@randombits.org at Apr 04, 2006 16:20
|
So, Martin, what exactly are you concocting? I thought you were more of a Twiki type of person? 

Posted by gfraser at Apr 04, 2006 16:23
|
Right tools for the right job 
I need to push the limits to properly understand and recommend.
All part of my wikiconsulting plan 

Posted by mrjcleaver at Apr 04, 2006 16:42
|
Aha! I should have thought of that.

Posted by mrjcleaver at Apr 04, 2006 16:43
|
(Thanks, BTW)
((and why can't I edit my comment!?!)

Posted by mrjcleaver at Apr 04, 2006 16:49
|
The comments have never been editable in Confluence, and I never understood why.
Feel free to drop me an email some time, some of your themeing ideas sound interesting: gfraser@adaptavist.com

Posted by gfraser at Apr 04, 2006 16:52
|
I agree with you, Guy. There's a feature request for Editable Comments here: CONF-830. Go vote for it.

Posted by jnolen at Apr 04, 2006 19:49
|
Is there a size restriction? When I make a template over a certain size, it gives me an error and won't save. I can't find any information about a restriction on template length...

Posted by sltrunzo at Jan 15, 2007 12:23
|
Hi,
For us to further investigate this, please create a support request at:
https://support.atlassian.com
Also could you please attach a screenshot of the error generated and a zip of your logs directory to the issue for us to look further into it.
Thanks,
Tony

Posted by t10 at Jan 15, 2007 21:40
|
|