In a real template a page wizard will query for the name, short description, and probably for some other information. In this case the ac:placeholder element will be replaced with a at:var element. In addition to that you may also want to internationalize your template. That is allow to create document instances for different locales. The resulting document will therefore more likely look like this: Code Block |
---|
| <ac:structured-macro ac:name="projectdoc-properties-marker">
<ac:rich-text-body>
<div class="table-wrap">
<table class="confluenceTable">
<tbody>
<tr>
<th class="confluenceTh"><at:i18n at:key="projectdoc.doctype.common.shortDescription"/></th>
<td class="confluenceTd"><at:var at:name="projectdoc.doctype.common.shortDescription"/></td>
<td class="confluenceTd"></td>
</tr>
<tr>
<th class="confluenceTh"><at:i18n at:key="projectdoc.doctype.common.doctype"/></th>
<td class="confluenceTd">my-doctype</td>
<td class="confluenceTd">hide</td>
</tr>
<tr>
<th class="confluenceTh"><at:i18n at:key="projectdoc.doctype.common.name"/></th>
<td class="confluenceTd"><at:var at:name="projectdoc.doctype.common.name"/></td>
<td class="confluenceTd"></td>
</tr>
</tbody>
</table>
</div>
</ac:rich-text-body>
</ac:structured-macro>
|
For the sake of simplicity for this introduction, we will stick to a mono-lingual version (English) and not bother with wizard data. It also makes sense to add some additional formatting and to embed the properties table and the section into layout elements like this: Code Block |
---|
| <ac:layout>
<ac:layout-section ac:type="single">
<ac:layout-cell>
<ac:structured-macro ac:name="projectdoc-properties-marker">
<!-- ... as seen above -->
</ac:structured-macro>
<!-- ... add the sections here (we will see this later) -->
</ac:layout-cell>
</ac:layout-section>
</ac:layout> |
This way you get a valid XML element and may also add additional layout-cell elements to give your template more visual appealing structure. Tip Box |
---|
Create your template as a page in your Confluence instance. This way you can use the features of the visual editor to create your tables, sections and other page elements. Use the Confluence Source Editor to copy the XML in Confluence Storage Format and then add additional elements (like the at:var or ac:placeholder elements) to it. |
For the reminder of this tour we will stick to the simple structure we started with above, but you now know the difference between our playground and the real stuff. |