Difference between revisions of "Creating Text templates"
From OpenKM Documentation
m |
|||
Line 27: | Line 27: | ||
${missing_value!"The default one"} | ${missing_value!"The default one"} | ||
− | + | The result is a PDF conversion of the HTML template with the client input requested by OpenKM. | |
[[Category: Installation Guide]] | [[Category: Installation Guide]] | ||
[[Category: OKM Network]] | [[Category: OKM Network]] |
Revision as of 13:13, 5 April 2011
For this kind of template will create an HTML one. This is the template source code:
<html>
<body>
<h1>Sample template</h1>
<table>
<tr>
<td><b>Name</b></td>
<td>${okp_tpl_name!}</td>
</tr>
<tr>
<td><b>Bird Date</b></td>
<td>${okp_tpl_bird_date!}</td>
</tr>
<tr>
<td><b>Language</b></td>
<td>${okp_tpl_language!}</td>
</tr>
</table>
</body>
</html>
The tags ${okp_tpl_name!}, ${okp_tpl_bird_date!} and ${okp_tpl_language!} will be replaced by the user input values. An error will occur and abort the template processing if you try to access a missing variable, but the ! operator handles this situation. In addition, you can put a default value in case of a mission one with this expression:
${missing_value!"The default one"}
The result is a PDF conversion of the HTML template with the client input requested by OpenKM.