# Fragment

{% hint style="info" %}
The `fragment`block is a container (invisible on the front end) to which you can add a `fragment` (containing one or more template parts).
{% endhint %}

This allows you to add one or more template parts wherever you are in your Template, Page, Post etc.    &#x20;

## Add a Fragment Block

* Search for the <img src="/files/sHJscThWb2nW7KToY5IY" alt="" data-size="line"> `button` block in the Quick Inserter or Inserter Panel.
* Click the `fragment` block to insert it into your parent block.

<figure><img src="/files/Fgoah2LYcptCZLl2sGX1" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh4.googleusercontent.com/LSgnlI6MXn33fCWd00mLfJuFGThimfPwfcjliPFFgfcu9Dt7D_aXAzheCziVJo8OI9Rr6KlLgrkXvUKGvZmQ6rGpcTlS7hQ2c3NvrRx0OklmUj9f2RVqB-_UvJp2gMcHuzsG8A69tll7HGGTSpa_aNIkFxe1X1qA6nH3Dltvtf0hMWqrrqXfm77BgychEg" alt=""><figcaption></figcaption></figure>

{% embed url="<https://www.youtube.com/watch?t=444s&v=Hj4qzIE7OTc>" %}
How To - Global Parts & Fragments
{% endembed %}

## Add a Fragment

You can add a fragment (multiple template parts) to your `fragment` block, such as headers, footers or custom fragments.

### Add Global Header and/or Footer

By default, Global Headers and Footers are available in the Fragment dropdown.

* Select a `fragment` block.
* Choose Global Header or Global Footer in dropdown as required.

<figure><img src="/files/OzfZjLGXdY7LyVJCPBIt" alt=""><figcaption></figcaption></figure>

Alternately:

* Open the Block Inspector.
* Choose required Global Fragment in the dropdown.

<figure><img src="/files/omtLIvK9i7ecq6MP9b0Q" alt=""><figcaption></figcaption></figure>

### Add a Custom Fragment

A Custom fragment can be added from the Cwicly Themer in the Dashboard.

* From the Dashboard, open the Cwicly Themer.
* Open Fragments(top left corner)
* Click "+ Fragment" to open the New Fragment modal.
* Input Fragment name and click Create.

<figure><img src="/files/7hgz8J7zvJyj2pg8eW8A" alt=""><figcaption></figcaption></figure>

* In the Custom section, click the "+" icon next to the Fragment you wish to add.

<figure><img src="/files/ACtXLRpbmHxIngFCqPXn" alt=""><figcaption></figcaption></figure>

* Select the required Custom fragment in the dropdown.

<figure><img src="/files/6aG60FCk4sNTXoFuKksL" alt=""><figcaption></figcaption></figure>

* Select the required Custom fragment in the dropdown in the Block Inspector.

<figure><img src="/files/Ymiw1fqF75bkwV2INBCA" alt=""><figcaption></figcaption></figure>

{% content-ref url="/pages/LKg8ryDi6Vrxo5f3gi5x" %}
[Fragments](/themer/general/fragments.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/fragment.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.
