HOC SiteDokümantasyon

Array template

Decoration and visibility use Dekorasyon ve görünürlük (BlockShell).

List/repeater primitive: repeats its content slot once per item of an array or entry[] variable (or array-like binding). Set arrayBinding to a whole-value token such as {{var:hits}}, {{var:items}}, {{bind:requests.<name>.results}}, or {{bind:…}}. Inside the slot the current row is aliased as item — use {{var:item.<fieldKey>}} (and nested paths). A text array item is the whole {{var:item}}. For entry[] results, object field keys are flattened from fieldValues onto item so tokens omit .fieldValues. Optional Authored layout.columns (+ columnGap / rowGap) lays rows out as a CSS grid (each row is a grid item). minItems (default 1) hides the public template when there are fewer items — use 2 for a size selector that should disappear on a one-size product. Prefer columns on the template rather than wrapping it in a single GridListBlock cell. A GridListBlock cell is one direct child, so a card is one wrapper. For outer gaps or columns around the template, use FlexListBlock or GridListBlock. Row DOM ids are suffixed with -{index}. Child blocks hide empty item fields with Authored shell.visibility ({ compare: { var: "item.link", op: "empty" }, is: false }). Prefer save_component_preset kind=list. Column and gap settings live under layout.columns (+ the two gap leaves), not a top-level columns. Inside a reusable component, set it on this block in the component document (get_components then save_component); a ComponentBlock mount on the page has no layout props, and shell.layout.* on the mount is saved but ignored.

Examples

Search hits list

{
  "content": [
    {
      "type": "HeadingBlock",
      "props": {
        "text": "{{var:item.title}}",
        "size": 24
      }
    }
  ],
  "data": {
    "arrayBinding": "{{var:hits}}"
  }
}

Component input items

{
  "content": [
    {
      "type": "HeadingBlock",
      "props": {
        "text": "{{var:item.name}}"
      }
    }
  ],
  "data": {
    "arrayBinding": "{{var:items}}"
  }
}

Fields

content

Template slot rendered once per array item. Tokens resolve in a scope where the current row is item ({{var:item.<fieldKey>}}, or {{var:item}} for a scalar). Empty arrays render nothing on the published site; the editor shows a single sample row.

content: [{ type: "HeadingBlock", props: { text: "{{var:item.title}}" } }]

data

arrayBinding

Whole-value {{var:id}} or {{bind:id}} selecting an array or entry[] source. Nested object arrays use {{var:parent.field}}. Partial/string interpolation is ignored — binding must be the entire token.

data: {
  arrayBinding: "{{var:hits}}"
}

minItems

Minimum item count before the public template renders. Default 1. Set 2 so a single option (a one-size product) renders no selector. The editor still shows the sample row.

data: {
  minItems: [{ if: "*", is: 2 }]
}

layout

columns

Authored column count. Bare number or [{ if, is }] (use bp conditions for per-breakpoint counts).

layout: {
  columns: [{ if: "*", is: 3 }]
}

columnGap

Authored gap between columns, in pixels. Bare number or [{ if, is }].

layout: {
  columnGap: [{ if: "*", is: 16 }]
}

rowGap

Authored gap between rows, in pixels. Bare number or [{ if, is }].

layout: {
  rowGap: [{ if: "*", is: 16 }]
}

Default props

{
  "content": [],
  "emptyContent": [],
  "shell": {
    "visibility": [
      {
        "if": "*",
        "is": true
      }
    ],
    "anchor": {
      "anchorId": [
        {
          "if": "*",
          "is": ""
        }
      ],
      "anchorKey": [
        {
          "if": "*",
          "is": ""
        }
      ]
    },
    "pointerEvents": [
      {
        "if": "*",
        "is": "auto"
      }
    ]
  },
  "data": {
    "arrayBinding": ""
  }
}