This documentation relates to the latest version of Confluence.
If you are using an earlier version, please go to the documentation home page and select the relevant version.

Form Field Markup for Templates

All Versions
Click for all versions
Confluence 2.9 Documentation

Index

Templates are written in the same notation as other pages in Confluence with special markup to insert form fields. When a user creates a page using a template that contains form fields, the user will be prompted to key in data. The data will be captured and stored in the new page.

Here are the three kinds of form fields supported and the markup to create them:

Text field
@VAR@

Creates a text input field for a variable called VAR.
Text area
@VAR|textarea(5,10)@

Creates a 5 x 10 text-area for a variable called VAR.
Drop down menu
@VAR|list(one,two,three,four)@

Creates a drop-down box containing the values "one", "two", "three" and "four".
Note: The values in the drop-down list can only contain letters, numbers and underscores.
The dropdown list values cannot include:
  • special characters, such as '&'
  • punctuation marks, such as ':'
  • brackets, such as ')'

Every input field must have a unique name. If you have more than one text input field in the same template with the same name, 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).

For an example, please see Adding a Template.

Warning
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.


Improved Markup

The above formatting is the basic markup bundled with Confluence, but two plugins expand on this markup to provide greater functionality. Links to these plugins and a comparison can be found in the Working with Templates Overview.

RELATED TOPICS

Working with Templates Overview
Scaffolding Plugin
Zones Plugin
Adding a Template
Editing a template
Creating a Page using a Template

Take me back to Confluence User Guide

Labels:

templates templates Delete
Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.
  1. Sep 10

    Burke Mamlin says:

    Is it possible to change the size of a text input field in a template?  I t...

    Is it possible to change the size of a text input field in a template?  I tried @VAR|textfield(50)@, @VAR|text(50)@, @VAR|size(50)@, @VAR|length(50)@, @VAR|50@, and @VAR|(50)@ with no success.  The default text field size is too small when I want to ask for a phrase or sentence.  Since you can control the size of the textarea, it only seems logical that you could do the same with the textfield.

    I tried searching/googling.  Maybe I'm just overlooking something simple?

    1. Sep 16

      Azwandi Mohd Aris says:

      Hi Burke, Currently, only the size of text areas can be specified in the templa...

      Hi Burke,

      Currently, only the size of text areas can be specified in the template markup. There is an improvement request on this at CONF-1475. Feel free to put your comments, be a watcher and cast your vote to increase the popularity of the request. Also, please bear in mind on how we schedule new features in our product. Hope that helps.

      Cheers,
      Azwandi

  2. Sep 12

    Anonymous says:

    I'm trying to create a variable inside of a link in a template: * [@pageTo...

    I'm trying to create a variable inside of a link in a template:

    *

    [@pageToLinkTo@] - want user to enter the page name and it to output to: [Library Page]
    
    
    I'm also trying to do the same to open a page attachment:
    
    [@filename@} - want user to enter the attachment name and it to output: [foo.swf]
    
    Finally, like to be able to do the same with media:
    
    !@filename@|width=100, height=100\! - want user to enter attachement file name and it to output !foo.swf|width=100, height=100!

     In all of these cases, the variable gets treated as the link or file name by the template, so rather than getting in input box, they get [@filename1@]

    Escaping the brackets/exclaimation points doesn't work either. Any suggestions?

    1. Sep 22

      Azwandi Mohd Aris says:

      Hi there, As far as I am concerned, this is due to the priority in Confluence t...

      Hi there,

      As far as I am concerned, this is due to the priority in Confluence to render the wiki markup over the template field markup. However, you can try to add another field with the same variable name, since the same value will be applied to the copied field:

      Insert link: @pageToLinkTo@
      This is the link to my page: [@pageToLinkTo@]
      

      This will result in unnecessary extra information, but still, a workaround that you can give a try. Hope that helps.

      Cheers,
      Azwandi

  3. Sep 25

    Anonymous says:

    Hi, Can you anyone provide me a pointer on how to create tabs in the page? I wa...

    Hi,

    Can you anyone provide me a pointer on how to create tabs in the page? I want to create tabs in the home page, so that user can navigate between tabs.

    Thanks for your help in advance.

    1. Sep 25

      Azwandi Mohd Aris says:

      Hi there, You might want to check out the {card} macro of third-party Compositi...

      Hi there,

      You might want to check out the {card} macro of third-party Composition Plugin. Hope that helps.

      Cheers,
      Azwandi

  4. Oct 09

    Anonymous says:

    Is there a way to name the page when you inserting the variables, so that it tak...

    Is there a way to name the page when you inserting the variables, so that it takes one of the variables as the page name?

Add Comment