Confluence 3.4 has reached end of life
Check out the [latest version] of the documentation
Using a macro, you can add extra functionality or include dynamic content in a page. For example, the Attachments macro will list a page's attachments in the page itself, so that readers do not have to visit the Attachments tab.
On this page:
Including a Macro in your Page
There are two ways to include a macro in your page. You can add macros using the visual Macro Browser, or by manually typing a macro command into the editor.
Including Macros with the Macro Browser
To insert a macro into a page using the Macro Browser,
- Open the Confluence page or blog post that you want to edit, then click the 'Edit' button.
- Click the Macro Browser icon on the toolbar. The macro browser window will open.
- Scroll through the list of macros to find the one you want. Alternatively, start typing the macro name into the search box at the top right of the macro browser. Macros with a matching name will appear in the main pane.
- Click the desired macro.
- Set the macro parameters to your requirements. If desired, you can preview these changes by clicking 'Refresh'.
- Click 'Insert' to add the macro onto the page.
You can also insert macros via autocomplete. For more information, see Using Autocomplete in the Rich Text Editor.
For a complete description of the macro browser, see Working with the Macro Browser.
Including Macros with the Confluence Editor
In the Confluence editor, a macro is simply a command wrapped inside curly braces {...}.
For instance, the Attachments Macro is written as:
{attachments}
Macro Parameters
Many macros allow you to include optional parameters to control the macro's output.
With the Attachments Macro, for instance, you have two optional parameters:
- To specify the file formats of the attachments displayed.
- To choose whether or not you want old versions of the attachments displayed.
These optional parameters are included within the curly braces, following a colon, like this:
{attachments:patterns=.*jpg}
When specifying more than one parameter within the same macro, use the pipe symbol ('|') to separate one from the other, like this:
{attachments:old=true|patterns=.*jpg}
Case Sensitivity in Macro Parameters
Macro parameters are case sensitive. In most cases, the macro will expect its parameters to be in lower case. Make sure you follow the documentation for the specific macro and match the expected case, otherwise the parameter may be ignored.
For example, this code correctly has the parameter 'patterns' with a lower case 'p' as expected by the Attachments Macro:
{attachments:patterns=.*jpg}
This code will not work, because the parameter 'Patterns' has an upper case 'p', which the Attachments Macro will not recognise:
Invalid macro code:
{attachments:Patterns=.*jpg}
Macros Shipped with your Confluence Installation
When you download your Confluence installation file, many macros are shipped with the download. Below is a list of the macros currently shipped with Confluence. Click a macro name for details of the usage, including optional parameters and examples.
Displays a list of attachments belonging to the current page. |
|
Lists the most recent news items in the space. |
|
Includes a list of bookmarks on a Confluence page. |
|
Displays a history of updates made to a page. |
|
Displays a chart based on tabular data. |
|
Displays the words "I like cheese!" |
|
Displays the children and descendants of the current page. |
|
Displays code in your document with the appropriate syntax highlighting. |
|
Changes the colour of a block of text. |
|
Used with the Section Macro. Defines columns within the page. |
|
Renders a list of content associated with specific labels. |
|
Renders a create space button linked to the create space page. |
|
Displays a dynamic task list which can be modified in 'view' mode. |
|
Displays an 'Edit in Word' icon on your page. |
|
Allows you to define a part of the page as the page's 'excerpt' which is then used by other macros to summarise a page's content. |
|
Allows you to display an excerpt from another page within the current page. |
|
Displays a list of your favourite pages. |
|
Forms a thumbnail gallery of all images attached to a page. |
|
Renders a list of links to global reports within a table. |
|
Renders your specified HTML code within the current page. |
|
Includes the content of an external HTML file into a Confluence page. |
|
Displays graphically when a contact is online. |
|
Inserts the contents of the specified page into the current one. |
|
Displays a block of text in a blue highlight box. |
|
Displays a list of JIRA issues in a page. |
|
Displays a JIRA dashboard portlet in Confluence. |
|
Display a summary of JUnit test results. |
|
Add a dynamic search box to a wiki page. |
|
Display a few paragraphs of pseudo-Latin text. |
|
Renders the list of pages associated with a specified label as a navigable map. |
|
Displays a block of text in monospace font. |
|
Prevents the browser from automatically hyperlinking a URL. |
|
Displays a block of text in a yellow highlight box. |
|
Displays a block of text within a fully customisable panel. |
|
Displays a dynamic, hierarchical list of pages starting from a specified parent (root) page. |
|
Adds a search box to your Confluence page and searches a hierarchy of pages starting from a specified parent (root) page. |
|
Displays a list of recently changed content (pages, news items, comments, etc). |
|
Lists labels most recently used in a specified scope (Global, Space, or Personal) |
|
Lists labels frequently appearing on the same pages as the current page's labels. |
|
Displays the contents of an RSS feed. |
|
Searches Confluence, and includes the results in the page. |
|
Used with the Column Macro to define columns within the page. |
|
Includes the summary of a Confluence space in the page. |
|
Displays a list of all spaces visible to the user. |
|
Displays a table of contents from your page headings. |
|
Displays a table of contents from a defined page 'zone'. |
|
Displays a block of text in a green highlight box. |
|
Displays a list of Confluence users, from an optional group. |
|
Embeds an Office document into your Confluence page. |
|
Displays a block of text in a red highlight box. |
|
Same as the Widget macro. |
|
Includes the Confluence site welcome message. |
|
Displays videos, slide shows, twitter chats, documents and more, sourced from other web sites and displayed on your Confluence page. |
Information about Other Macros
Macros Provided by Plugins or User Macros
Other macros are available as plugins or as user macros, and can be installed by your Confluence administrator.
Customers using Adaptavist macros or plugins might be interested in the Adaptavist's Confluence user guide.
Some examples are:
- {sp-list} macro, provided by the Confluence SharePoint Connector – full documentation in the SharePoint Connector space.
- {float} macro and others, provided by the Composition plugin – full documentation by CustomWare.
- {status} macro, a user macro that your administrator can add to your site. It displays a coloured lozenge, useful for reporting project status. See our documentation.
- {expand} macro, a user macro that your administrator can add to your site. It displays an expandable/collapsible section of text. See our documentation.
Macros that Do Not Work
Some macros were never intended for external use, and we have always recommended that you do not add them to a wiki page. Nevertheless, it is possible that some Confluence sites have these macros on some pages. Please note that these macros no longer work in Confluence 3.4 onwards. They were part of the Plugin Repository, which we have now replaced with a new plugin manager.
These macros no longer work:
- {repository-plugin}
- {recentlyupdated-plugins}
- {popular-plugins}
- {download-stat}
- {confluence-status}
- {plugin-status}
- {plugin-repository}
- {plugins-supported}
Writing your own Macros
To learn how to write your own macro, take a look at the following documentation:
- User macros are simple template-like macros that allow you to create simple formatting macros using the Confluence web interface. Read more about Writing User Macros.
- The Confluence Plugin Guide tells you how to develop a plugin for Confluence.
RELATED TOPICS
Working with the Macro Browser
Confluence Notation Guide Overview
Atlassian Plugin Exchange
Installing Plugins and Macros
Take me back to the Confluence User's Guide.