Let's write a simple macro that creates a red box (using an existing Confluence style) around some text. This may be useful for writing about error conditions, for example. For full details about creating a user macro, see the guide to writing user macros.

Defining the 'Error' user macro

To create the 'Error' user macro:

  1. Choose the cog icon  at top right of the screen, then choose Confluence Admin.
  2. Choose User Macros in the left-hand panel.
  3. Choose Create a User Macro at the bottom of the list of macros.
  4. Enter the macro attributes as follows:
    • Macro Name: error
    • Visibility: Visible to all users in the Macro Browser
    • Macro Title: Error
    • Description: Displays a red box around some text
    • Categories: Confluence Content
    • Icon URL: You can leave this field empty.
    • Documentation URL: You can leave this field empty.
    • Macro Body Processing: Rendered
    • Template:

      ## @noparams
      <div class="error">$body</div>
  5. 保存を選択します 。

(warning) The information on this page does not apply to Confluence OnDemand.

Using the 'Error' macro on a page

To add the macro to a page, edit the page and choose InsertOther Macros and find the 'Error' macro. (Or use autocomplete: start typing '{err' in the editor, and select the 'Error' macro from the list of suggestions that appears.)

Your page will display an error box, like this:

(Write your error message here.)

  • ラベルなし