テンプレートから作成マクロは、ページにボタンを表示し、特定のテンプレートにリンクします。ボタンをクリックするとマクロがエディターを開き、新規ページ追加の準備が整い、所定のテンプレートに基づいてページへのコンテンツを追加します。

When adding the macro to the page, you can specify a blueprint or a user-created template in the macro. You will also specify the name of the button displayed, and the space in which the new page will appear.

スクリーンショット:3 つのボタンが表示されたページ - すべて「テンプレートからの作成マクロ」による表示

テンプレートから作成マクロマクロを使用する

ページにテンプレートから作成マクロマクロを追加するには:

  1. In the Confluence editor, choose Insert > Other Macros.
  2. Find and select the required macro.

オートコンプリートでマクロを素早く入力する方法

Type { and the beginning of the macro name, to see a list of suggested macros. Details are in Using Autocomplete.

既存のマクロを編集する方法: マクロのプレースホルダをクリックして、[編集] を選択します。マクロのパラメータが編集可能な場合、マクロのダイアログ ウィンドウが開きます。

パラメーター

Parameters are options that you can set to control the content or format of the macro output. Where the parameter name used in Confluence storage format or wikimarkup is different to the label used in the macro browser, it will be listed below in brackets (example).

パラメーター

必須

既定

説明

Button Text 'Create from Template'ページ上で表示されるマクロの説明。
Template Name なし新規ページのベースとなるテンプレートまたはブループリントを選択します。現在のスペースに対しグローバルおよびユーザーが作成したテンプレートのみが表示されます(「スペース キー」欄で異なるスペースを指定してる場合は除く)

Template Title

 

空白

このマクロを使用して作成したページに既定値のタイトルを指定します(任意)。タイトルには、変数; @currentDate、@spaceName、@spaceKey を使用できます。
Space Key 現在のページが作成されているスペース一意のスペース識別子(スペース キー)を与え、マクロを使用してページを作成する際に新規ページが作成される場所を特定します。

コー​​ドの例

次の例は、Confluence ページの基本的なマークアップを調べたり、編集したりする上級ユーザー向けに提供されています。 

マクロ名: create-from-template

マクロ本文: なし。

格納形式用のパラメーターは、以下のマクロブラウザで有効なパラメーターと異なります。 

パラメーター名必須既定パラメーターの説明と指定可能な値

templateId

ユーザーが作成したテンプレートに必須(なし)The ID of a user-created template. This is the unique identifier that Confluence assigns when you create a template. For example, 299630593. To find the ID of a template, edit the template and look at the URL in your browser. The template ID is given in the URL parameter named entityId.
blueprintModuleCompleteKeyブループリントに必須(なし) 

templateName

はい(なし)The ID of a user-created template (for example, 299630593) or the qualified name of the add-on that defines the blueprint (for example, com.atlassian.confluence.plugins.confluence-shared-files-plugin:file-list-blueprint).
buttonLabelはい'Create from Template'ページ上で表示されるマクロの説明。
spaceKeyはい現在のページが作成されているスペースマクロを使用してページを作成する際に新規ページが作成される場所を特定するための、一意のスペース識別子(スペース キー)。
Titleいいえ(なし)The title for pages created using this macro. You can include @currentDate, @spaceName and @spaceKey variables in the title. This title will override any title specified in a blueprint template.

保存形式の例

この例では、ユーザーが作成したテンプレートを指定しています。

<ac:structured-macro ac:name="create-from-template">
  <ac:parameter ac:name="templateId">299630593</ac:parameter>
  <ac:parameter ac:name="buttonLabel">Blitz test</ac:parameter>
  <ac:parameter ac:name="spaceKey">
    <ri:space ri:space-key="DOCTHEME"/>
  </ac:parameter>
  <ac:parameter ac:name="templateName">299630593</ac:parameter>
</ac:structured-macro>

この例ではブループリントを使用しています。

<ac:structured-macro ac:name="create-from-template">
  <ac:parameter ac:name="blueprintModuleCompleteKey">com.atlassian.confluence.plugins.confluence-shared-files-plugin:file-list-blueprint</ac:parameter>
  <ac:parameter ac:name="buttonLabel">Shared files</ac:parameter>
  <ac:parameter ac:name="spaceKey">
    <ri:space ri:space-key="DOCTHEME"/>
  </ac:parameter>
  <ac:parameter ac:name="templateName">com.atlassian.confluence.plugins.confluence-shared-files-plugin:file-list-blueprint</ac:parameter>
</ac:structured-macro>

Wiki マークアップ

このマクロでは Wiki マークアップは使用できません。Wiki マークアップを使用して、このマクロを追加することはできません。

  • ラベルなし