Confluence 5.0 has reached end of life
Check out the [latest version] of the documentation
This example demonstrates how you can pass parameters to your macro. We'll create a font style macro which has two parameters to allows the user to specify the colour and size of the text contained in the macro body.
Before you start, see Writing user macros for an introduction to creating your own user macros.
- Go to > General Configuration > User Macros.
- Choose Create a User Macro.
- Enter the macro details (see table below)
- Choose Add.
| Field | Value |
|---|---|
| Macro name | stylish |
| Visibility | Visible to all users in the Macro Browser |
| Macro Title | Stylish |
| Description | Applies colour and size to text. |
| Categories | Confluence Content |
| Icon URL | You can leave this field blank |
| Documentation URL | You can leave this field blank |
| Macro body processing | Rendered |
| Template | Enter the code below in the template field. If your macro requires more than one parameter, you can use variables $param0 to $param9 to represent them. ## @param 0:title=colour|type=string ## @param 1:title=size|type=string <span style="color: $param0; font-size: $param1">$body</span> Alternatively, you can also use explicitly-named parameters in your macro. These macro parameters will appear as variables with the name $param<x> where <x> is the name of your parameter. ## @param Colour:title=colour|type=string ## @param Size:title=size|type=string <span style="color: $paramColour; font-size: $paramSize">$body</span> |
Overview
Content Tools
Apps

