この例では、テキスト「Hello World!」を表示するユーザーマクロや、ユーザーがマクロ本文に配置するテキストの作成方法を示します。

Before you start, see Writing user macros for an introduction to creating your own user macros. 

Defining the 'Hello World' user macro

To create the 'Hello World' user macro:

  1. Go to  > General Configuration > User Macros.
  2. Choose Create a User Macro.
  3. マクロの詳細を入力します (以下の表を参照)。
  4. Choose Add.

フィールド
macroNamehelloworld
表示方法Visible to all users in the Macro Browser
マクロ タイトルHello World
説明 Displays "Hello World" and the macro body.
カテゴリConfluence Content
アイコンの URLこのフィールドは空白のまま残すことができます
ドキュメント URLこのフィールドは空白のまま残すことができます
マクロ本文処理レンダリング済み
テンプレート

テンプレート フィールドに以下のコードを入力します。この例では、テキストをページ上に直接プリントします。

## @noparams
Hello World!
$body

If you wanted the text to appear in a panel you could include the relevant AUI message class as shown here.

## @noparams
<div class="aui-message closeable">
Hello World!
$body
</div>

ページでの 'Hello World' マクロの使用

マクロ ブラウザーを使用するか、エディターに「{hello」と入力し、候補のリストからマクロを選択して、Confluence ページにマクロを追加することができるようになりました。

結果は次のようになります。

パメルを含めるよう選択した場合、結果は次のようになります。

  • ラベルなし