A template defines how the results from the datasource are displayed. There is a separate article with various examples on templating in PocketQuery: Templating Tutorial. In the following, you will find the more technical documentation that lists all available objects and functions provided by PocketQuery.
Each template entity consists of the following properties:
Name: The name identifying the template.
<script>tags) to arrange the data of your result. Note: It might be helpful to start with the default template and then adjust it to your needs step by step. Click the text link on the top right above the content field to get its code inserted.
Available Velocity Objects
Velocity enables you to use a number of variables and call methods on specific objects. You can find all variables and objects that are available when writing PocketQuery templates here: Velocity API Available In Templates.
Gauge chart example
Bar chart example
Pie chart example
Default And Example Templates
PocketQuery uses some default code snippets for templates, which you can find in our example section: Template Examples and Tutorials. For further information and examples on templating in PocketQuery, refer to our article Templating Tutorial. For further information on the Velocity templating language, refer to the official website.
Template Configuration Parameters
PocketQuery provides some additional parameters for the template configuration, that are defined within the template content itself. They can be set using (exactly) the syntax “## @param key:value“.
The following parameters are available:
## @param plain:true
By default, PocketQuery renders content in an element
<div class="pocketquery-view-container"> to separate its content from the page. Setting this parameter to true makes your template render as plain text, i.e. there won’t be any HTML structure around your result rendered by PocketQuery. This can be useful if you want to use the output in another macro (meaning PocketQuery is nested in another macro or in a Confluence table).
## @param emptymsg:The query returned no result!
Specify what information message PocketQuery should print if the query returned no results.