|
To create a user macro:
The sections below tell you about each of the input fields.
Enter the text that people will see when looking for the macro in the Macro Browser.
Set the visibility options to specify who can see this macro when they are searching using the Macro Browser or Autocomplete.
User macros must have parameters defined in order to appear in the Confluence 4.0 Macro Browser. |
The options are as follows:
Visibility Option | 意味 |
|---|---|
すべてのユーザーに表示 | All users will see this macro when searching for a macro using the Macro Browser or Autocomplete. |
システム管理者にのみ表示 | Choose this option if you want the macro to be 'hidden' from most users when the users are looking for a macro to add to a page. Note that this does not completely hide the macro. Instead, it is useful if you want to avoid cluttering the Macro Browser and Autocomplete with unnecessary macros. Specifically, if you are:
Please note that all the macro information will also be discoverable, including the macro title, description, parameter names and other metadata. Do not include confidential data anywhere in the definition of a user macro, even if it is marked as visible only to system administrators. |
Enter the text that should appear in the Macro Browser and in Autocomplete, to identify this macro when people are looking for it to insert onto a page.
Enter the text that should appear in the Macro Browser describing this macro. Note that the Macro Browser's search will pick up matches in the description as well as in the title.
Select one or more categories for your macro. To select more than one category, hold down the 'Ctrl' key while selecting. These are the categories that appear in the Macro Browser, helping users to choose a macro from a logical set.
If you would like the Macro Browser to display an icon for your macro, enter the URL here. You can enter an absolute URL or a path relative to the Confluence base URL. For example:
Absolute URL:
http://mysite.com/mypath/status.png |
Relative URL:
/images/icons/macrobrowser/status.png |
Enter the URL pointing to the online help or other documentation for your macro.
Specify how you want Confluence to process the body of your macro before passing it to your macro. Below is an explanation of the macro body and the options available.
The macro body is the content that is displayed on the wiki page. If the macro allows a body, users will be able to enter body content when configuring the macro in the Macro Browser.
If you specify that your macro has a body, you will be able to pass text to the macro when you invoke it from within a page.
If your macro has a body, any body content that the user enters will be available to the macro in the $body variable. See the section about the template below. In addition, the options below allow you to tell Confluence to pre-process the body before it is placed in the macro output.
Body Processing Option | 意味 | |||
|---|---|---|---|---|
No macro body | Select this option if your macro does not need a body. | |||
エスケープ済み | If your macro has a body, and you make use of the body as
Then value of $body will be:
This will render as:
| |||
| Unrendered | If your macro has a body, and you make use of the body as $body in your template, HTML in the body will be processed within the template before being output. Ensure that HTML is ultimately output by the template. | |||
レンダリング済み | If your macro has a body, and you make use of the body as
Then value of $body will be:
This will render as: |
Enter code to specify what the macro will do. For example, to add a macro inside the macro you are writing, you would write:
<ac:macro ac:name="someOtherMacro" /> |
クイック ガイド:
See our detailed guide to writing a user macro template.
参照先:
Developer documentation:
Community contributions
Be careful when installing user macros. Ideally use only macros from authors and sources that are well known to you. |