Rate this page:
Available: | Confluence 2.3 and later |
User macro is a kind of Confluence plugin module.
With user macro plugin modules, developers can define simple macros directly in the atlassian-plugin.xml
file
without writing any additional Java code. User macro plugin modules are functionally identical to user macros configured through
the administrative console, except that they can be packaged and distributed in the same way as normal plugins.
Configure entire macro plugin modules inside the atlassian-plugin.xml
file as follows:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
<atlassian-plugin name='Hello World Macro' key='confluence.extra.helloworld' pluginsVersion='2'>
<plugin-info>
<description>Example user macro</description>
<vendor name="Atlassian Software Systems" url="http://www.atlassian.com"/>
<version>1.0</version>
</plugin-info>
<user-macro name='helloworld' key='helloworld' hasBody='true' bodyType='raw' outputType='html'>
<description>Hello, user macro</description>
<template><![CDATA[Hello, $body and $paramexample !]]></template>
<parameters>
<parameter name="example" type="string"/>
</parameters>
</user-macro>
<!-- more macros... -->
</atlassian-plugin>
<template>
section is required. It defines the velocity template that renders the macro.user-macro
element match the configuration for user macros (see available attributes later on this page).parameter
elements are the same as for xhtml-macro.Attribute | Allowed Values |
---|---|
hasBody |
|
bodyType |
|
outputType |
|
Rate this page: