To use placeholders in macros we recommend that you install the Confluence Source Editor to be able to make changes to the XHTML.
Macros with parameter validation
There are macros such as the Jira macro, for example, where parameters are validated. In this case you may not be able to save parameters with placeholder contents.
If this happens, add the macro to the page and edit the macro configuration contents using the source editor. Here you can enter the placeholders in the parameters.
Template ID
Placeholders in macro parameters may not be entered directly, because additional HTML elements are not supported within the parameters. For this reason, information about the parameter and placeholders used are stored outside the macro when the initial placeholders are entered.
To be able to assign this information to a macro, a macro ID is used for identification. However, some macros change their macro ID each time you edit the page. In this case, an additional parameter called "templateId" must be added to the macro. The template ID must be unique on a page. You can use the current macro ID as the template ID or enter your own.
<p> <ac:structured-macro ac:macro-id="b13194b8-74c2-40f2-8160-d6f719a41b07" ac:name="jira" ac:schema-version="1"> <ac:parameter ac:name="server">Your Company JIRA</ac:parameter> <ac:parameter ac:name="columns">type,key,summary,created,updated,reporter,assignee,status,resolution,user value,time value,risk value,cost of delay,job size,wsjf</ac:parameter> <ac:parameter ac:name="maximumIssues">20</ac:parameter> <ac:parameter ac:name="jqlQuery">issuekey = $#{Key} or (issueFunction in linkedIssuesOfRecursive("issuekey = $#{Key}","relates to")) </ac:parameter> <ac:parameter ac:name="templateId">4609bc8c-7e36-4d78-a548-4b1ee7db237a</ac:parameter> <ac:parameter ac:name="serverId">70e799df-76f2-328c-9f2c-7a36590692ac</ac:parameter> </ac:structured-macro> </p>
The resulting generated Confluence page will look as follows.
<p> <ac:structured-macro ac:macro-id="7d49ecf7-a3fa-4ba2-9aeb-3336d59d2ccc" ac:name="jira" ac:schema-version="1"> <ac:parameter ac:name="server">Your Company JIRA</ac:parameter> <ac:parameter ac:name="columns">type,key,summary,created,updated,reporter,assignee,status,resolution,user value,time value,risk value,cost of delay,job size,wsjf</ac:parameter> <ac:parameter ac:name="maximumIssues">20</ac:parameter> <ac:parameter ac:name="jqlQuery">issuekey = PORTFOLIO-30 or (issueFunction in linkedIssuesOfRecursive("issuekey = PORTFOLIO-30","relates to"))</ac:parameter> <ac:parameter ac:name="templateId">4609bc8c-7e36-4d78-a548-4b1ee7db237a</ac:parameter> <ac:parameter ac:name="serverId">70e799df-76f2-328c-9f2c-7a36590692ac</ac:parameter> </ac:structured-macro> </p> <div class="pi-placeholder-macro-id-4609bc8c-7e36-4d78-a548-4b1ee7db237a pi-placeholder-param-name-jqlQuery" style="display: none;"> issuekey = <span class="pi-placeholder-Key">PORTFOLIO-30</span> or (issueFunction in linkedIssuesOfRecursive("issuekey = <span class="pi-placeholder-Key">PORTFOLIO-30</span>","relates to")) </div>
Macros with links as parameters
Some macros such as the Include Page macro use links to Confluence pages as parameters. Placeholders can also be used here, for example, to include generated pages. If you edit the parameters using the source editor, format the content with a Confluence link tag (see Confluence Storage Format).
<ac:structured-macro ac:macro-id="69577a1e-a123-43ef-9099-5ad2d5df6c2f" ac:name="include" ac:schema-version="1"> <ac:parameter ac:name="templateId">0de26f1e-a345-45fb-8daf-0d3fb7c50649</ac:parameter> <ac:parameter ac:name=""> <ac:link> <ri:page ri:content-title="$#{Key} - Epic Value Statement"/> </ac:link> </ac:parameter> </ac:structured-macro>