Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Background

In this demo we demonstrate how to use ConfiForms data as parameters for Atlassian Include page macro

You can see a complete configuration for you to import on the bottom of the page

Here is how it looks like in the editor 

Image Added

The tricky part is the set up of the "Include Page"  macro and you need to do it using Confluence source editor, as otherwise it does not accept dynamic parameters

The configuration for this macro should loom like this (assuming your information about what page to include is stored in "pageToInclude" ConfiForms Field of "Page/Blogpost" type)

Code Block
<ac:structured-macro ac:macro-id="b728042f-5210-47ca-a201-0927375638a9" ac:name="include" ac:schema-version="1"> 
  <ac:parameter ac:name=""> <ac:link> <ri:page ri:content-title="[entry.pageToInclude.title]" ri:space-key="[entry.pageToInclude.spaceKey]"/> </ac:link> </ac:parameter> 
</ac:structured-macro>

You can see we use "pageToInclude" objects properties to get the values for page title and space key.

See Accessing page properties for more details on which properties are available for each field type in ConfiForms

Realtime example

ConfiForms Form Definition
formNamemyform
myformsashINLINE


pageToIncludePage to includeTESTpage

We have 2 records stored in the form at the moment

ConfiForms TableView
formNamemyform


and we will show the contents of these pages with the help of Include Page macro

Show the contents. In this demo we show the contents (via include page) of 2 child pages (you can include any page you want)

...

Children pages

Children Display


Storage format (configuration) for the demo

Code Block
<ac:structured-macro ac:macro-id="f7bd459e-85e2-499e-9127-89684ea0e5ad" ac:name="confiform" ac:schema-version="1">
<ac:parameter ac:name="formName">myform</ac:parameter>
<ac:rich-text-body>
<ac:structured-macro ac:macro-id="096bc0a3-c584-4a1f-9db3-b7a73be4a592" ac:name="confiform-entry-register" ac:schema-version="1">
<ac:parameter ac:name="formName">myform</ac:parameter>
<ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<ac:structured-macro ac:macro-id="b07876a3-36b9-4c3f-8294-690d83f01ec8" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">pageToInclude</ac:parameter>
<ac:parameter ac:name="fieldLabel">Page to include</ac:parameter>
<ac:parameter ac:name="extras">TEST</ac:parameter>
<ac:parameter ac:name="type">page</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<br/>
</p>
<h2>Show the contents. In this demo we show the contents (via include page) of 2 child pages (you can include any page you want)</h2>
<ac:structured-macro ac:macro-id="826c226a-5bbc-40f5-bf85-f837aa086a16" ac:name="confiform-list" ac:schema-version="1">
<ac:parameter ac:name="formName">myform</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="7edd88ce-6a0d-4a38-9bf0-2070abe9207f" ac:name="confiform-field" ac:schema-version="1">
<ac:parameter ac:name="fieldName">pageToInclude</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="b728042f-5210-47ca-a201-0927375638a9" ac:name="include" ac:schema-version="1">
<ac:parameter ac:name="">
<ac:link>
<ri:page ri:content-title="[entry.pageToInclude.title]" ri:space-key="[entry.pageToInclude.spaceKey]"/>
</ac:link>
</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>