Hi, I want to create an annotated variant of the Include Page macro in confluence. My version should surround the included page in a panel and add a caption (included from <link>).
I got it working for pages in the same space, but not for pages in a different space, because I do not know how to set the <ri:page ri:space-key> parameter from my ## @param ip:title=Included Page|type=confluence-content|required=true|desc=Select a page to include parameter:
Example storage format for an include page macro:
<p><ac:structured-macro ac:name="include" ac:schema-version="1" ac:macro-id="7c3338cb-d85f-4aeb-8c61-5fb36e24d61f"><ac:parameter ac:name=""><ac:link><ri:page ri:space-key="TFML" ri:content-title="Instructions for use" /></ac:link></ac:parameter></ac:structured-macro></p>
My user macro:
## @param ip:title=Included Page|type=confluence-content|required=true|desc=Select a page to include
## @param Title:title=Title|type=string|desc=Title
<ac:structured-macro ac:name="panel">
<ac:parameter ac:name="borderColor">#6699CC</ac:parameter>
<ac:parameter ac:name="borderWidth">1</ac:parameter>
<ac:parameter ac:name="title">$!paramTitle</ac:parameter>
<ac:rich-text-body>
<p><ac:structured-macro ac:name="include" ><ac:parameter ac:name="">
<ac:link><ri:page ri:content-title="$paramip" /></ac:link></ac:parameter>
</ac:structured-macro></p>
<div><sub><em>(included from <ac:link><ri:page ri:content-title="$paramip" /></ac:link>)</em></sub></div>
</ac:rich-text-body>
</ac:structured-macro>
-------------
Of course, I could add a second @param where the user has to enter the space name, but that would be independend of the page parameter and allow invalid input combinations.
How can I extract the space from the confluence-content parameter or how can I construct correct links only using the confluence-content parameter?
(if I use a same-space-page in my macro, it works as expected, but for a foreign-space-page, this error message is rendered:
