# Blocks

Blocks are added to the schema and looped over inside the section in liquid.

```markup
<div class="hero">
  <div class="container">
    <h1>{{ section.settings.heading }}</h1>
    <div data-gb-custom-block data-tag="for">

      <a href="{{ block.settings.link_action }}">
        {{ block.settings.link_text }}
      </a>
    

</div>

  </div>
</div>
```

```yaml

<div data-gb-custom-block data-tag="schema">

  {
    "name": "Example Section",
    "elements": [
      {
        "type": "text",
        "id": "heading",
        "label": "Heading",
        "default": "This is an example heading"
      }
    ],
    "blocks": [
      {
        "type": "link",
        "name": "Link",
        "elements": [
          {
            "type": "text",
            "id": "link_text",
            "label": "Link Text",
            "default": "CALL TO ACTION"
          },
          {
            "type": "action",
            "id": "link_action",
            "label": "Link Action",
            "default": "http://www.kajabi.com"
          }
        ]
      }
    ]
  }

</div>

```

To build even more complex sections, a section can have multiple types of blocks that a user chooses from.

```markup
<div class="hero">
  <div class="container">
    <h1>{{ section.settings.heading }}</h1>
    

<div data-gb-custom-block data-tag="for">

      

<div data-gb-custom-block data-tag="case">

        

<div data-gb-custom-block data-tag="when" data-0='link'></div>

          <a href="{{ block.settings.link_action }}">
            {{ block.settings.link_text }}
          </a>
        

<div data-gb-custom-block data-tag="when" data-0='image'></div>

          <img src="{{ block.settings.image }}"/>
      

</div>

    

</div>

  </div>
</div>
```

```yaml

<div data-gb-custom-block data-tag="schema">

  {
    "name": "Example Section",
    "elements": [
      {
        "type": "text",
        "id": "heading",
        "label": "Heading",
        "default": "This is an example heading"
      }
    ],
    "blocks": [
      {
        "type": "link",
        "name": "Link",
        "elements": [
          {
            "type": "text",
            "id": "link_text",
            "label": "Link Text",
            "default": "CALL TO ACTION"
          },
          {
            "type": "action",
            "id": "link_action",
            "label": "Link Action",
            "default": "http://www.kajabi.com"
          }
        ]
      },
      {
        "type": "image",
        "name": "Image",
        "elements": [
          {
            "type": "image_picker",
            "id": "image",
            "label": "Image"
          }
        ]
      }
    ]
  }

</div>
```


---

# 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://themes.kajabi.com/liquid/building-blocks/blocks.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.
