Confluence 2.9 has reached end of life
Check out the [latest version] of the documentation
There are two ways to write a macro:
- The first way is to create a user macro. You need to be a Confluence Administrator to do this. Below is an example.
- The second, and more difficult, way is to create a user plugin.
Example of a User Macro
Here's how you can create a user macro which displays the text 'Hello World : ' in front of any variable text you place between the macro tags.
- Go to the 'Administration Console' and click 'User Macros' under 'Configuration' in the left-hand panel.
- Click 'Create a User Macro' at the top of the list of macros.
- Enter the macro attributes as shown in the following screenshot.
- Click the 'Save' button.
So, now you can add the following Wiki Markup on your Confluence page:
{helloworld}Matthew{helloworld}
And the result will be as follows:
More Information
The macro itself is written in the Velocity Templating Language. You can find more information in the Velocity User Guide from Apache.
RELATED TOPICS
Overview
Content Tools
Apps
