You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
« Previous
Version 6
Next »
For our FAQ article, we will use the repeating-data macro from Scaffolding Forms and text-data macro for form inputs. The repeating-data macro allows users to duplicate what is nested inside the repeating-data block.
We give the repeating-data block 5 initial rows so that a new copy of this template will render 5 question-answer pairs initially. The tutorial for this template can be found in our technical documentation.
Using the Live templates feature from Scaffolding Forms, we can create a new page with the live-template block, and render an FAQ article such as this one:
Great! Now users can quickly fill up the FAQ form with content and get going.
Finally, learn how you can a create a new article with this template in this tutorial.
Click here for the source code...
<ac:structured-macro ac:macro-id="c34f5a61-3bfc-4c06-9a93-38c949c5764c" ac:name="repeating-data" ac:schema-version="1">
<ac:parameter ac:name="name">faq</ac:parameter>
<ac:parameter ac:name="initialRows">5</ac:parameter>
<ac:rich-text-body>
<table class="relative-table wrapped" style="width: 61.3077%;">
<colgroup>
<col style="width: 20.5962%;"/>
<col style="width: 79.2683%;"/>
</colgroup>
<tbody>
<tr>
<th>Question</th>
<td>
<div class="content-wrapper">
<p>
<ac:structured-macro ac:macro-id="0b4e0050-5b63-49e5-b34f-50c37712af19" ac:name="text-data" ac:schema-version="1">
<ac:parameter ac:name="name">faq question</ac:parameter>
<ac:parameter ac:name="width">100%</ac:parameter>
<ac:parameter ac:name="type">line</ac:parameter>
<ac:parameter ac:name="content">text</ac:parameter>
<ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
<ac:rich-text-body>
<p> </p>
</ac:rich-text-body>
</ac:structured-macro>
</p>
</div>
</td>
</tr>
<tr>
<th>Answer</th>
<td>
<div class="content-wrapper">
<p>
<ac:structured-macro ac:macro-id="8316feea-e2c8-407b-b274-4dbeecc3b8df" ac:name="text-data" ac:schema-version="1">
<ac:parameter ac:name="name">faq question</ac:parameter>
<ac:parameter ac:name="width">100%</ac:parameter>
<ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
<ac:rich-text-body>
<p> </p>
</ac:rich-text-body>
</ac:structured-macro>
</p>
</div>
</td>
</tr>
</tbody>
</table>
</ac:rich-text-body>
</ac:structured-macro>
Imagine you'd like to modify the FAQ template and you have already created several FAQ pages. It would be a nightmare to have to update all of them individually.
By creating a live-template block on the page, the page renders the structure of a predefined template and displays the data entered by the user via forms. We only need to edit the template for its structure to be reflected across multiple pages running the same live template.