Documentation for Confluence 5.4.
Documentation for Confluence OnDemand and earlier versions of Confluence is available too.

Skip to end of metadata
Go to start of metadata

A template is a predefined page that can be used as a framework when creating new pages. Templates are useful for setting a common style or format for a page.

In Confluence, there are two places to store your page templates:

  • Space templates: These page templates are available in a specific space only. People who have space administrator permission can define templates via the space administration screen.
  • Global templates: These page templates are available in every space on the site. People who have Confluence Administrator permission can define the global templates via the Confluence Administration Console.

Adding a space template

Space templates are available in one space only.

To add a template for a space:

  1. Go to the space and choose Space tools > Content Tools on the sidebar. 
  2. Choose Templates Add New Space Template.

If your space uses the Documentation theme:

  1. Choose Browse > Space Admin at the top of the screen.
    Note: The 'Space Admin' option appears only if you are a space administrator for the space or you are a super user (a member of the confluence-administrators group).
  2. Choose Templates from the space administration options.
  3. Choose Add New Space Template.

The 'Create Template' screen will appear. Add content as described below.

Adding a global template

Global templates are available in all spaces in your Confluence site.

To add a global template:

  1. Choose the cog icon  at top right of the screen, then choose Confluence Admin.
  2. Choose Global Templates in the left-hand panel.
  3. Choose Add New Global Template.

The 'Create Template' screen will appear. Add content as described below.

Using the template editor

This illustration shows the template editor with an image, some text, styling, and variables.

The resulting form when the template contains variables

This screenshot shows the form displayed when someone creates a page based on the template containing the above variables. (See Creating a Page using a Template.)

Adding content to your template

Add a name for your template.

Enter text into the body of the template, and use the editor toolbar to apply styles, layout and formatting. You can add links and macros. In general, you can use the Confluence editor in the same way as on a page. In addition, you can add variables which will produce a form for data collection when someone adds a page based on the template.

Below are some points of special interest in templates.

Labels

Choose Labels to add one or more labels to the template. These labels will be included in all pages created using this template.

Images and other attachments

You cannot attach an image or other file to a template. Instead, attach the file to another page, and insert it into the body of the template.

For example:

  • You can attach an image to a page and then choose InsertImage to embed the image into the template.
  • You can attach a PDF file to a page and then choose InsertOther MacrosPDF to embed the PDF file into the template.

Variables used as form fields

You can add variables to your template, to act as form fields. When someone creates a page based on the template, Confluence will display a text entry box for each field. The user can enter data into each field, and the data is inserted onto the new page.

Every variable must have a unique name. If you add the same variable more than once in the same template, Confluence will make sure that they have the same value when the user saves the page. This is useful if you need the same information in more than one place in the page.

To insert a variable into a template:

  1. Place your cursor on the template where you want the variable to appear.
  2. Choose Template > New Variable from the editor toolbar. Alternatively, you can choose the name of an existing variable if you want the same variable to appear more than once in the template.
  3. Enter the variable name.
  4. Press Enter. By default this will create a single-line text input field.
  5. To change the variable type, click the variable placeholder. The variable's property panel will appear. Choose one of the variable types: TextMulti-line Text, or List. See below for a description of each type.

Speeding up variable entry with autocomplete: Type $ and the variable name, then press Enter, to add a new variable or to select an existing variable from a list of suggestions. The suggestions are drawn from variables already defined in this template.

These are the types of variable available:

Variable typeDescription

Text

Creates a single-line text input field.

Screenshot: A template variable called $purpose and its property panel

Multi-line text

Creates a text box that allows more than one line of text.

By default, the text area is 5 rows depth and 100 characters wide. You can change the size by typing over the digits in the variable property panel.

Screenshot: A multi-line variable and its property panel

List

Creates a dropdown list.

You must specify the values that will appear in the dropdown list. The values:

  • Must be separated by commas.
  • Can include letters, numbers, special characters, and spaces.
  • Cannot include commas (except as the list separation character).

Screenshot: A list variable and its property panel


Instructional text

Instructional text allows you to add placeholder content to a template.  This text is only visible in the editor and disappears when the author of the page begins typing.

To insert instructional text into a template:

  1. Place your cursor on the template where you want the instructional text to appear.
  2. Choose Template > Instructional Text on the editor toolbar.
  3. Begin typing - the instructional text appears in italics with a shaded background to distinguish it from normal paragraph text.

You can also change the placeholder type from 'text' to other types, including some that trigger an action such as a user mention or creating a JIRA issue.

The following instructional text types are available:

Instructional text typeDescription
Text

Creates a line of text that is only visible in the editor. Instructional text disappears when the user begins typing.

User Mention

Creates a line of text that is only visible in the editor. When clicked it triggers the @mentions dialog.

JIRA Issue

Creates a single link of text that is only visible in the editor. When clicked it triggers the JIRA Issues macro dialog. Users can then search for or create a new issue.


Adding a description to your template

The template description displays in the 'Create' dialog and is useful for explaining the purpose of a template to users.

To add a description to a template:

  • Go to the space or global templates page (as described above).
  • Choose the Edit icon in the 'Description' column.
  • Enter your description and save. 

Converting an existing page to a template

If you would like to convert an existing page to a template, you can copy the content from the page and paste it into the template editor. There is no automated way of doing this.

Please note the section above about images and other attachments in templates.

Notes

  • You cannot insert variables via the 'Insert wiki markup' option in the editor toolbar.
  • Page templates are used only when adding a page. It is not possible to apply a template to an already-existing page. Once a page has been added using a template, the template is no longer linked to the page. All further editing is performed as if the template was never used. Some plugins provide enhanced template functionality. You can search the Atlassian Marketplace for template add-ons.
  • When you use a Table of Contents macro in a template, you will see an error when you preview the template itself. But the Table of Contents macro works on the pages that people create from the template – the table of contents shows up after they have saved the page. (This is probably because the template is not defined as a page, and the Table of Contents macro works for pages only.)
  • The editor for templates is available only in Confluence 4.3 and later. Please refer to the earlier documentation for a description of the wiki markup editor templates.
  • Confluence also provides 'system templates' containing content like the site welcome message and default space content. See Administering Site Templates.

58 Comments

  1. Are template variables capable of being used by the Reporting plugin?

  2. Anonymous

    That's really cool. Sadly I can't use Wiki Markup within the variables form fields, as it is ignored at rendering. The ability to do that would have been THE feature to show me superior.

    Cheers,

    Dom

  3. Anonymous

    Hi!

    "Hint: the Editor will automatically convert wiki markup as you type it."

    What is wiki markup for variable type list and other?

  4. Anonymous

    Is it possible to fill the list with values that are stored somewhere else, for instance values of a certain JIRA custom field?

    1. No it's not possible. The values are fixed and stored with the template.

  5. Anonymous

    Is it possible to set a default location on a template, so that when you create a page from the template it automatically goes to that location?

    1. Sure would be great to be able to do this for some templates. 

  6. Hello, is it possible to build a template page with a child page (also templated) ?

  7. Anonymous

    Hi. Is it possible to set a variable for the location of a link, while keeping the link text constant? Thanks.

    1. Has anyone figured out how to do this, even via a workaround?  I've tried using the variable in a link, but it just gets entered as plain text and breaks the link.  I also tried inserting the variable into a shortcut link, but I haven't had any luck there, either.  This functionality would be very useful.

  8. Is there an equivalent to Page History for the templates? It would be nice to be able to roll back if a change turned out to be "not so nice".

  9. Anonymous

    Atlassian,

    I love your products.  In our office have Confluence, JIRA and Stash.  We get a lot of benefit from it.  Despite all the great things that all your software does, there's one thing that really annoys me no end.  Why can we not have live templates in Confluence?

    We're currently creating a new service-based framework for our company's website and warehouse, which is for a reasonably well-known, high-end fashion label.  We have taken the steps to document the software and I'm the primary author of all the documentation.  On more than one occasion, despite the best-laid plans, I've had to do a lot of back-tracking and editing of documents which are in templates.  Well, they were created via templates.

    I'm aware there's the scaffolding plug-in and perhaps you're not adding a feature like this so you don't step on their toes.  My issue is that we have a 50-user licence for JIRA and will be most probably be upgrading our Confluence licence to a similar level in the near future because it is being implemented in other departments, too.  This means we'll have spent thousands of pounds on Confluence but we still have to spend a lot of time and money on man-hours changing documents, which you would hope you'd not have to do.  Even Word and Dreamweaver have templates!

    I'm still an Atlassian fan and having championed Confluence to get it approved and purchased, I'm not going to not use it.  I'm crossing my fingers that you'll look into providing a feature which would be a massive boon to your software.

    (Name witheld)

    1. Hallo Anonymous

      Thank you for your feedback. I've passed it on to the Confluence product managers.

      Cheers, Sarah

    2. Thanks for your feedback. I'm not sure I understand what exactly you are after with "live templates" - are you asking if scaffolding will be core to the product? 

      We don't have any plans on doing this as it fundamentally takes the product into a forms-based solution. Strategically, this isn't where we want to head. Once you have forms in place, the next set of questions you get are around showing/hiding fields, and then workflows attached to that form. Right now, we feel JIRA is the best place for that. We could look at improving the JIRA create experience inside Confluence which somewhat relates to it. 

  10. Is there a way to have the "New variable" field embedded within a metadata tag? Our organization would like to be able to use templates to create project references, then create a project report somewhere else in the space. Ideally, users would see the text field for data entry when filling out a new template, instead of manually entering data in "Edit Mode".

    1. I am trying to do this as well. Did you find a solution?

      Thanks.

    2. I am trying to do this as well.  Please advise if a solution has been identified.

  11. Are links to anchors (i.e. - #anchorname) supported in templates? I am seeing an error when I try this.

  12. Anonymous

    Variables doesn't work in Confluence version 5.1.2? 

    1. Hi there

      I can confirm that template variables do work in 5.1.2 both when inserting from the editor tool bar, or using the "$" insert. Could you provide us with more info please? I can insert text using these variables when the template is chosen.

      Please clarify what you mean by "variables doesn't work" - is the problem when you're attempting to insert variables when creating the template? Or is it that the text you substitute for the variables isn't showing up in the editor on page create?

      Thanks,

      Joey

      1. Anonymous

        Hi,

        our confluence version is 5.1.4. We have problem with variables in template. 

        Problem case:

        Open some space -> create -> Add or customise templates for the selected space -> Create New Template:

        Template name: Test template

        Template body: click on Template button -> add 3 variables (Table 1) - > Save

        NameTypeValue
        $textTemplateText 
        $dropDownBoxListSpace A, Space B, Space C
        $textAreaMulti-line text 

         

        After page template is crated -> go to the specific space -> Create -> Choose Test template -> Fill template:

         

        NameTypeValue
        $textTemplateText Text label
        $dropDownBoxListChoose Space C
        $textAreaMulti-line text

         Multi-line text Multi-line text ...

        text text text

        text

         

        -> Next -> Was created page with this content:

        Text label

        Space A

        Conclusion: 

        Variable $textTemplate working well, but $dropDownBox write bad value (always first item from list box) and inserted value from $textArea  is missing. 

         

        Thanks Radek


        1. Hi,

          It's a bug in the version of Confluence 5.1.4. I tried the same script in Confluence version 5.1.3 and it works fine. In version 5.1.4 does not really work.

          Tomas

           

          1. Hi Tomas and Radek - this issue is tracking progress on the fixing of the defect

            CONF-29763 - Template variable values are lost going into Edit Mode Resolved

            Thanks for raising.

            Cheers,

            Joey

  13. In JIRA 4.3 we used template text variables with the code block macro.  This would allow us to populate text and make it safe to cut and paste from Confluence to terminals etc.  It appears this is not longer supported.  Is there a way to do this or a workaround? 

    example template:

    Variable: $test_variable

     

    I have tried a few ways to escape it and have the confluence markup override the code block but no luck.

     

    Thanks!

    1. Hi Rob - thank you for pointing this out to us. I have raised an issue on your behalf.

      CONF-29162 - template variables cannot be used in code macros Open

      I don't have a neat workaround but this may serve your purpose.

      1. Insert template variable as you would normally (sans code macro)
      2. create page from template as you would normally - insert value(s) for variables
      3. In the editor, highlight all the text you want to be able to copy and paste to terminal and either
        1. select "preformatted" style
        2. copy and paste it to a code macro
      4. Save the page

      You will then have the monospaced text you normally have if you could insert variables into code macros. I hope this helps.

      Regards,

      Joey

      P.S. Are you the anonymous customer that reported variables don't work in 5.1.2 in the comment above?

      1. Hi Joey,

        Thanks for this!  Sadly, I'm not the anonymous poster about variables not working.  Variables work, just not the way we'd expected.  We've got your workaround in place.  I suspect with the move to the xhtml for the markup engine there are going to be some odd little outcomes.  That being said, if it can be restored it would be amazing.  We get a great deal of mileage out of the ability to expand variables in code macros, links and other places where it might not be totally expected to see a variable.

         

        r.

        1. Hi Rob - unfortunately, the ability to use template variables in links and macro parameters has been an issue that has been neglected for many years.

          CONF-3324 - Support replacement of page template variables in wiki links and macro parameters Open

          Am I understanding your request correctly? If so, please feel free to vote on the issue.

          Thanks,

          Joey

  14. Anonymous

    There's no such thing as "Space Tools" on the side menu – I think this help page needs to be updated. I had to go to My Name in the top bar, then Templates, then add a template. Help pages are of no use if they don't provide step-by-step instruction for each case!

    1. Hi Anonymous, sounds like your space may not be using the default theme.  

      The default theme provides a link to Space Tools in the sidebar. The Documentation theme provides a link under the Browse menu.  Instructions for both of these Atlassian supported themes are provided above. 

      Sounds like you might be using a different, third party theme perhaps?  You might want to check with your Confluence Administrator to find out what theme your space is using. 

      Rachel

  15. I am looking for a documentation specifically for Confluence 4.0 for working with Templates. Can anyone point me to that?

    1. Hi Neeraj, 

      Sorry for the late reply.  You have found the right place, documentation for each major version can be found in its own space.  This page is handy for navigating to all versions of the Confluence documentation - Confluence Documentation Directory

      Rachel

  16. Anonymous

     

    Hello,   is it possible to build a template page with a several child page (also templated) ?  For example I would like to create a page (from a template) for each project we have in progress and then have links automatically generated for Requirements, Design etc. for each project, each of which referring to it's relevant template.

    1. Hi Anonymous - unfortunately, there is no way to currently do that.

      cc Sherif Mansour [Atlassian] as this might be a useful blueprint style idea.

  17. Anonymous

    On the Global Templates page, we do not have a Description column or a pencil icon. Consequently, when choosing a template, our employees don't see a description under that title. Do you know why that's happening?

  18. Anonymous

    Hi! Is there a way to have a checkbox (list of checkboxes) variable or allow multiple selections with list variables? For example, for $product, there might be a need to select more that one entity, which seems not possible currently. Thanks in advance!

  19. I've also been looking for checkboxes as a variable.

    I was hoping to be able to use the List type and use (error) and (tick) emoticons so there's an eye-catching way to show options on a template.  When I type those in, I get the literals, rather than the rendered emoticons, and when I try to use the code editor to see if I could hack it, it seems the combination of using variables in a template and editing the code causes the page to break (List options are rendered as literals at the very top of the Template preview, after trying to edit options in the code.

     

  20. Is there a way to insert multiline instructional text? It seems that a soft line break works while editing the template but is removed when the template is saved. Would be great to save multiline instructional text in templates. Thanks.

  21. Anonymous

    Hi, I am trying to create a space template, just followed the instructions provided in this article or document, but I not working.

    After I select 'Create the template', it gives plain text box for the template and do not show word tools like inserting table, changing format, font, etc.,

    can you please help me adding the template?

    1. Hi Anonymous, the instructions on this page relate to Confluence 5.2.  If you are seeing a simple text field when you add a template you may be using an earlier version of Confluence. Have a look at the documentation for Confluence 4.2 here Adding a Template to see if this is closer to what you are seeing. 

  22. Hi!

    Please tell me if there'll ever make the correction  CONF-29162 - template variables cannot be used in code macros Open  ?

    This is a very important part of the template functional (sad)

     

    Привет!

    Скажите, пожалуйста, будет ли когда-нибудь сделано исправление  CONF-29162 - template variables cannot be used in code macros Open  ?

    Это очень важная часть фунционала (sad)

  23. I am trying to add automatic labelling via templates. So I add a label "deliver" to the product requirements template. When I create the a new page using product requirements template, then it only adds "requirements" automatically. "deliver" does not appear.

    Dont see any comments with this problem... So is it that I am doing some thing wrong?We are using 5.1.2

    1. Hi, unfortunately it is not currently possible to add additional labels to blueprint templates.  

      What you could do is use a space template instead of the blueprint.  Go to Space Admin > Content Tools > Add Template and make a template that contains the same content as the requirements blueprint template - specify the label 'requirements' (so that it will appear correctly in your index page) and also add your additional label 'deliver'. 

      You could then disable the Requirements blueprint in the space, and select your custom template from the Create dialog instead.  As the index page has already been created - it will continue to display the pages with the label 'requirement'. 

      Hope this workaround does the trick for you. 

  24. HI Support, 

    When we add a page with blue print templates, automatically space shortcut is created. Is it possible to add "Space Shortcut" for custom space templates in on demand Confluence , like blue prints.

    Thanks in advance.

    1. There is no way to do this automatically I'm afraid.  You can manually add space shortcuts after a page has been created, but not automatically like the blueprint does. Sorry!

  25. Anonymous

    Is there a wikipedia infobox like Template in confluence ? If not could you provide a rough markup for me to create something like that ?

  26. Is there a wikipedia infobox like Template in confluence ? If not could you provide a rough markup for me to create something like that ?

    1. You don't need wikimarkup to create templates anymore, you can create them in the editor.  You might want to experiment with page layouts and the panel macro to achieve the look you are after. 

  27. Hi, is it possible to create a global template and make it available only for some spaces? We need special templates for only a couple of spaces, and adding this as space templates is a big update problem. Because we don't want to update this templates in every space.

    1. Hi Marcel,  no its not currently possible to make global templates only available for some spaces.

      One workaround would be to promote the templates you wish to be available in each space (which will hide your global template under the show more link in the create dialog) - however as you cannot promote a global template, in the spaces where you want your global template to appear, no templates should be promoted, so the global template is visible.  Its not an ideal workaround, and may turn out to be more effort than updating your templates across several spaces. 

  28. Anonymous

    Is it possible to delete variables from a template? I created some and then changed my template, so I'm not using them anymore. I'd like the predictive list to only show the current list of variables, not the obsolete or misspelled ones. 

    1. Sorry I'm not aware of a way to do this. The variables are tied to the template, so you could create a new template with just the variables you want to use, and then remove the old template.  Not ideal, but I think that would give you a clean list of variables in your new template.

      1. Anonymous

        Thanks for the reply. It's too bad there's no way to do this in the template, but I appreciate the workaround!

  29. Hi

    I do not have the options "user mention" and "JIRA issue" while configuring a new variable. 

    Any help will be greatly appreciated

    1. Hi Elvir,  The options user mention and JIRA issue appear when you add placeholder text not a variable.   Hope this helps. 

       

  30. Hi,

    I would like to reuse variables to set the title of the new page. Is this somehow possible?

    Thanks in advance.

    1. Hi Stefan, 

      You can't set the page title of a page created from a template in the template itself. You can however do this using the Create from Template Macro - however the variables that can be used are limited to basic ones like @currentDate, @spaceName and @spaceKey. 

      Hope this helps. 

  31. Hi Rachel,

    thanks for your response.

    we actually use the "create from template macro". But we want to take several parts of the users input and construct the page name from it. This way it would be much easier to keep naming standards for pages.

    Never mind, it is not the end of the world. (smile)

    Cheers