> ## Documentation Index
> Fetch the complete documentation index at: https://hilfe.converic.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom HTML block

> Build a website section in your own HTML and CSS with fields you edit in the sidebar. Covers field definitions, Liquid templates, filters and design tips.

The Custom HTML block lets you build a website section in your own HTML and CSS when no built-in block fits your design. You define fields such as a headline, an image or a list of features, and anyone on your team can then change that content in the editor sidebar without touching the code. This page explains the field definitions, the template syntax, design rules and limits, and ends with a complete example.

> [!NOTE]
>
> The Custom HTML block is only available on websites, not on landing pages.

## How the block works

When you select a Custom HTML block in the website editor, the sidebar shows three parts:

| Part | What it does |
| - | - |
| **Fields** | The inputs defined in your field definitions. This is where you fill in the content. |
| **HTML** | The section's HTML, written as a Liquid template. Open it with **Edit code**. |
| **Field definitions (JSON)** | The list of fields the section offers. Open it with **Edit code**. |

In the code editor, **Format code** tidies the indentation.

**1. Add the block**

Add a **Custom HTML** block to a page of your website.

**2. Define the fields**

Under **Field definitions (JSON)**, click **Edit code** and list the fields the section needs.

**3. Write the HTML**

Under **HTML**, click **Edit code** and write the markup. Output each field with `{{ block.name }}`.

**4. Fill in the content**

Fill in the inputs under **Fields**. The preview shows the result.

> [!TIP]
>
> The info icon next to **Field definitions (JSON)** opens this page. An AI assistant connected through the [AI connector](https://hilfe.converic.com/ai-connector/overview.md) can write the HTML and the field definitions for you.

## Field definitions

Field definitions are a JSON list. Each entry describes one field:

| Property | Description |
| - | - |
| `name` | Name in the template, for example `block.headline`. Starts with a letter or underscore and only contains letters, digits and underscores. Every name must be unique. |
| `label` | Label in the sidebar. If you leave it out, the name is shown. |
| `type` | One of the field types below. |
| `default` | Optional. Value used while nothing is filled in. |

When a field has no value and no default, the template receives an empty value: empty text, `0` for numbers, `false` for switches and an empty list for lists.

### Field types

| Type | Description |
| - | - |
| `text` | Single-line text. |
| `textarea` | Multi-line text. |
| `richtext` | Formatted text, output as HTML. |
| `number` | A number. |
| `switch` | On or off, `true` or `false` in the template. |
| `select` | Choice from `options`, a list of `{ "label", "value" }`. |
| `color` | A color as hex value. |
| `date` | A date like `2026-10-01`. |
| `image` | An image from your files. Output the URL with the `asset_url` filter. |
| `icon` | An icon from the icon picker. Output it with the `icon_svg` filter. |
| `link` | A URL or an anchor on the page. Output it with the `link` filter. |
| `list` | Repeatable entries with their own `fields`. |

Two types need extra properties:

* **select** needs `options`, a list of `{ "label", "value" }`. Every value must be non-empty and unique.
* **list** needs `fields`, the fields of each entry. Lists can't contain other lists. Set `itemLabel` to the name of a `text` field to use it as the title of each entry in the sidebar.

### Example

```json Field definitions theme={null}
[
  { "name": "headline", "label": "Headline", "type": "text", "default": "Hello" },
  { "name": "photo", "label": "Photo", "type": "image" },
  {
    "name": "layout", "label": "Layout", "type": "select", "default": "left",
    "options": [
      { "label": "Image left", "value": "left" },
      { "label": "Image right", "value": "right" }
    ]
  },
  {
    "name": "items", "label": "Benefits", "type": "list", "itemLabel": "title",
    "fields": [{ "name": "title", "label": "Title", "type": "text" }]
  }
]
```

If the JSON is invalid, a message under **Field definitions (JSON)** names the field and the problem.

## Using fields in the HTML

The HTML is a [Liquid](https://liquidjs.com/) template. Every field is available under `block`:

```liquid Template syntax theme={null}
<h2>{{ block.headline }}</h2>

{% for item in block.items %}
  <p>{{ item.title }}</p>
{% endfor %}

{% if block.showButton %}
  <a href="{{ block.buttonLink | link }}">{{ block.buttonLabel }}</a>
{% endif %}
```

* Output is HTML-escaped automatically, so text fields can't break your markup.
* `richtext` fields are output as HTML.
* Standard Liquid tags and filters work, for example `upcase`, `date` or `size`.
* `include`, `render` and `layout` are not available.

### Filters

Converic adds four filters for its field types:

```liquid Filters theme={null}
<img src="{{ block.photo | asset_url }}" alt="{{ block.photo.altText }}">
<span>{{ item.icon | icon_svg }}</span>
<a href="{{ block.cta | link }}">Contact us</a>
<script>const items = {{ block.items | json }};</script>
```

* **asset\_url** returns the URL of an image field. The alt text you enter in the sidebar is available as `altText`.
* **icon\_svg** turns an icon field into an inline SVG. Icon names are [Lucide](https://lucide.dev/icons/) names like `shield-check`.
* **link** outputs a link field. Only `https://` URLs, paths like `/contact`, anchors like `#pricing`, `mailto:` and `tel:` links pass. Anything else becomes `#`.
* **json** outputs a value as JSON for use inside a `<script>` tag.

### Language

`{{ language }}` contains the language of the section, `en` or `de`. You set it under **Layout & visibility** in the block settings.

```liquid Language theme={null}
{% if language == "de" %}Impressum{% else %}Imprint{% endif %}
```

### Website variables

Website variables like `{{city}}` only work inside field values, not in the HTML or the field definitions. Type them into a field in the sidebar, for example in the headline.

## Design tips

* The page stylesheet only covers the built-in blocks. Put your CSS in a `<style>` tag inside the HTML and prefix every selector with a class unique to the section, for example `.cx-features h2`.
* Use the theme variables so the section matches your website:

| Variable | Use |
| - | - |
| `var(--primary)` | Primary color |
| `var(--primary-foreground)` | Text on the primary color |
| `var(--secondary)` | Secondary color |
| `var(--secondary-foreground)` | Text on the secondary color |
| `var(--font-heading)` | Heading font |
| `var(--font-body)` | Body font |
| `var(--button-radius)` | Button corner radius |

* Put every text, image, icon and link you may want to change into a field instead of writing it into the HTML.
* Scripts run on the published website. The editor preview runs them in a sandbox.

## Limits and errors

* A section can be at most 64 KB.
* Template errors show as a message above the section in the editor preview.
* If a template has an error, publishing stops with a message that names the page and the block, so you can fix it before anything goes live.

## Complete example

This feature grid has a headline, a formatted intro, a list of features with icon, title and text, and an optional button.

```html HTML theme={null}
<section class="cx-features">
  <style>
    .cx-features { padding: 80px 24px; background: #f5f5f5; }
    .cx-features .cx-inner { max-width: 1120px; margin: 0 auto; text-align: center; }
    .cx-features h2 { margin: 0 0 12px; font-family: var(--font-heading); font-size: clamp(28px, 4vw, 40px); }
    .cx-features .cx-grid { display: grid; gap: 24px; margin-top: 40px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); text-align: left; }
    .cx-features .cx-card { padding: 24px; border-radius: 16px; background: #fff; }
    .cx-features .cx-icon { color: var(--primary); }
    .cx-features .cx-button { display: inline-block; margin-top: 40px; padding: 12px 24px; border-radius: var(--button-radius); background: var(--primary); color: var(--primary-foreground); text-decoration: none; }
  </style>
  <div class="cx-inner">
    <h2>{{ block.headline }}</h2>
    {{ block.intro }}
    <div class="cx-grid">
      {% for item in block.items %}
      <div class="cx-card">
        <span class="cx-icon">{{ item.icon | icon_svg }}</span>
        <h3>{{ item.title }}</h3>
        <p>{{ item.text }}</p>
      </div>
      {% endfor %}
    </div>
    {% if block.showButton %}<a class="cx-button" href="{{ block.buttonLink | link }}">{{ block.buttonLabel }}</a>{% endif %}
  </div>
</section>
```

```json Field definitions theme={null}
[
  { "name": "headline", "label": "Headline", "type": "text", "default": "Why customers choose us" },
  { "name": "intro", "label": "Intro", "type": "richtext" },
  {
    "name": "items",
    "label": "Features",
    "type": "list",
    "itemLabel": "title",
    "fields": [
      { "name": "icon", "label": "Icon", "type": "icon", "default": "check" },
      { "name": "title", "label": "Title", "type": "text" },
      { "name": "text", "label": "Text", "type": "textarea" }
    ]
  },
  { "name": "showButton", "label": "Show button", "type": "switch", "default": true },
  { "name": "buttonLabel", "label": "Button label", "type": "text", "default": "Get in touch" },
  { "name": "buttonLink", "label": "Button link", "type": "link", "default": "#contact" }
]
```

After saving both, add your features under **Fields**, for example "Fast" with the `clock` icon, "Reliable" with `shield-check` and "Personal" with `users`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.