This page last changed on Aug 31, 2011 by pwatson.

This page tells you how to create a user macro that displays the text 'Hello World!' and any variable text you place between the macro tags. (For full details about creating a user macro, see the guide to writing user macros.)

Defining the 'Hello World' User Macro

To create the 'Hello World' user macro:

  1. Go to the 'Confluence Administration Console' and click User Macros in the left-hand panel.
  2. Click Click here to create a new User Macro at the top of the list of macros.
  3. Enter the macro attributes as follows:
    • Macro Name: helloworld
    • Visibility: Visible to all users in the Macro Browser
    • Macro Title: Hello World
    • Description: Displays "Hello World" and the macro body
    • Categories: Confluence Content
    • Icon URL: You can leave this field empty.
    • Documentation URL: You can leave this field empty.
    • Macro Body Processing: Render HTML
    • Output Format: HTML
    • Template:
      ## @noparams
      Hello World!
      $body
      
  4. Click Save.

Screenshot: Definition of the 'Hello World' user macro

Using the 'Hello World' Macro on a Page

Now you can add the macro to your Confluence page.

  • Using wiki markup:
    {helloworld}What a beautiful day.{helloworld}
    
  • Using the Macro Browser:

The result is:

Related Topics

Writing User Macros


helloWorldOutput.PNG (image/png)
helloworldMacro.PNG (image/png)
helloworldMacro.PNG (image/png)
Document generated by Confluence on Sep 19, 2011 02:42