# Query Template

## Query Template

A Cwicly `Query Template` block sets out a graphical interface that helps run a Query with different parameters. This means you can change values that a query uses without special knowledge of coding quickly and efficiently.

You can customise colours in the same way as a `Query` block. You can also customise the Query Template Layout by modifying grid type, height and row gap and column gap.

{% hint style="info" %}
The Cwicly `Query Template` block is added inside a C`wicly Query` Block.
{% endhint %}

<figure><img src="https://lh4.googleusercontent.com/n7ry0DMpnc-xj0guQ9Fdm8yz20ocegcPVSpnGJ4FFIdDShbBPtgdtbQWOk7faAwHAUQSzm7y72jTKip-3WlB9B836YUbgYEPX5YJGr2gFQa5qxzbVnTovp4IhV3QKacm8zmc9bYTD2AOLUJ-qjFgjaL55gPFboA0AFWfmRzXCKNakqodT3UJJ77Foqo2Kg" alt=""><figcaption></figcaption></figure>

<details>

<summary>Add</summary>

1. Open the Quick Insert panel in the Query block
2. Search for the Cwicly Query Template block
3. Click on the Cwicly Query Template block to insert it into your Cwicly Query block

</details>

{% embed url="<https://www.youtube.com/watch?v=2qVaGrFWLT8>" %}
TTD #19 - Queries
{% endembed %}

## Query Placeholder

To make it easier to set up your Query, when you add a `query` block, a placeholder will pop up to guide you.

You can either "Add  Query Template" or "Add Pagination Wrapper".

### Add Query Template

This will insert a Query Template directly into your `query` block.

<figure><img src="https://lh5.googleusercontent.com/nxsDYvjUs9mnZOOl6I6HEZvge_yULXjoXIlsIGG6i481vdm5ApX414D_mGBt67uxh9BfjGHat_n81BMhAeCWRSVQQ4GkzhpZBY56fcBMpZ61Ulg5wiU2mbReI54PgjnYRsazaS0BCUuEKpmRitXt3Sk6TKxcKAfEfhCh5bw1b6Pc7I4bLM2QUCbnqP5CBQ" alt=""><figcaption></figcaption></figure>

This will open an "Add Block" placeholder, from which you can add the type of blocks you require in your Query.&#x20;

<figure><img src="https://lh3.googleusercontent.com/lYpFiF49bm0jBlKD0xCZlXgFE70C1rNnU2Uhh8sMhXuW4uR9i_XDt3IY_4TSHXAenj_jql5xepUtqlT6boULvRt43Av6_O0rF9QZige-Sz-yYjx7WsdrhZmW7QdlVeurgb_1RhXoAAqt7AyYq_MQt4Rf_5rdAgnBm9NIN_VkA1dE5t5Qjx5JXHb_H-CjNA" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh3.googleusercontent.com/Pv4v2dEjmdMOJQWdnWNv70r97D8JOpzTs7zE730hDfuW-wVXApvGzlwZNPdI1n2oKFpjlkHkxnLk4pJGQFBx84HuxRb-gJzzcpHO0tvKFeOuNNLzjYyOFtQ4hSzr8P4x_Lwq8ZfYd-EAMPoMPN6ZVy7Fd1Jo-WAlvkVpdYBumMuApLqWbEiMNO-KSrwoMw" alt=""><figcaption></figcaption></figure>

### Add Pagination Wrapper

{% content-ref url="/pages/Xk1mw3YKZY04wthjvmx8" %}
[Query](/blocks/query.md)
{% endcontent-ref %}

## Layout

The Layout tab allows you to modify how your Items are displayed in your `Query Template` block.

{% content-ref url="/pages/jLEslyXlPHC6O8xsPlr5" %}
[Layout](/blocks/query-template/layout.md)
{% endcontent-ref %}

## Colours

The Colours tab allows you to modify the Colours of the content in your Query Template block, including Text colour, Link colour, Background colour.

![](https://lh3.googleusercontent.com/ROJw01Xr2MWfwI5KlxjDIZ3o-BHW1Z_PiAac02sYDjqUJLF9aT2vCKFi_lyx9P3zBmJba5UjFLg7IMt1XHv3-kZ2sHkya_F3MlJRKNJjAJuuOL36vGVirTIOHQM9Qm9e0Hpluhm73uzeLV1AJIgg2JklHfiEvAYFwIJ2_oS6hAiKGYh1wgkkWKaAsxbb2g)

<details>

<summary>Modify</summary>

1. Select a Template Query block
2. Open the block inspector
3. Navigate to the primary tab
4. Open the Colours tab
5. Modify the Colours of your text, link, background

</details>

<details>

<summary>Reset</summary>

1. Select a Query Template block
2. Open the block inspector
3. Navigate to the primary tab
4. Open the Colours tab
5. Click appropriate button to remove modifications to the Colours of your text, link, background

</details>

## Grid editor

The Grid Editor tab allows you to visually edit & design your Query template Grid layout.

{% content-ref url="/pages/XBh0Ay1h2oCc1ddEVYfT" %}
[Grid editor](/blocks/query-template/grid-editor.md)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cwicly.com/blocks/query-template.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
