テンプレートは、新しいページの作成時にプロトタイプとして使用可能な事前定義済みのページです。テンプレートはページに共通のスタイルやフォーマットを与えるために利用します。

Adding a space template

Space templates are available in one space only.

To add a template for a space:

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

On this page:

関連ページ

Adding a global template

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

To add a global template:

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

A template illustration

テンプレート エディタを使用する

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.

ラベル

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

画像とその他の添付ファイル

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.

例:

The image or other file type will be displayed on all pages created using this template. The file will not be attached to the pages, but will be referenced from the page that you first attached it to.

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.

変数をテンプレートに挿入する方法

  1. Place your cursor on the template where you want the variable to appear.
  2. Choose $ Variables from the editor toolbar.
  3. Choose Add New Variable. Alternatively, you can choose the name of an existing variable if you want the same variable to appear more than once in the template.
  4. Enter the variable name.
  5. Press Enter. By default this will create a single-line text input field.
  6. 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:

変数タイプ説明

Text

Creates a single-line text input field.

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

複数行テキスト

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

一覧

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


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 rich text editor pane in the template editor. There is no automated way of doing this.

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

注意