Skip to main content
Skip table of contents

Default PocketQuery Templates

PocketQuery uses some default code snippets for templates, which you can find here. For further information and examples on templating in PocketQuery, refer to our Templating Tutorial.

Default Template

The default template is a good example for a very simple table template. If you want to extend its functionality when creating a new template, you can always add the code below automatically by clicking the text link "Add default template".

HTML
<table class="aui confluenceTable pocketquery-table">
  <thead>
    <tr>
    #foreach ($column in $columns)
      <th>$!column</th>
    #end
    </tr>
  </thead>
  
  <tbody>
    #foreach ($row in $result)
      <tr>
      #foreach ($column in $row)
        <td>$!column</td>
      #end
      </tr>
    #end
  </tbody>
</table>

Default Form Template

There is a second default template, that is less obvious than the one above. If the macro option "Use change params template" is enabled, PocketQuery adds a simple form above the template used (which can be the default template or any other).

HTML
<form method="get" class="aui pq-dynamic-parameter-form" action="">
  #foreach($entry in $otherParameters.entrySet())
    <input type="hidden" name="$entry.key" value="$entry.value" />
  #end

  <button type="submit" class="pq-change-button aui-button aui-style aui-button-primary">Change</button>

  #foreach($entry in $pocketQueryParameters.entrySet())
    <div>
      <label for="pq_$entry.key">$entry.key</label>
      <input class="text" type="text" id="pq_$entry.key" name="pq_$entry.key" value="$entry.value" />
    </div>
  #end
</form>
  
$PocketQuery.template("selected-template")

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.