Dynamic Blocks

Dynamic blocks are per-product rich content — grids of image, video, 3D, and text elements rendered on the B2B product detail page. They are stored on the product document as a dynamic_blocks array (Mongo only; excluded from the Solr index) and attached to the storefront response by a gated enrichment step. Each block belongs to one language.

Where the field goes

On import, add dynamic_blocks to any product in the products[] array:

{
  "source_id": "<your-source-id>",
  "products": [
    {
      "entity_code": "<your-product-code>",
      "dynamic_blocks": [ /* blocks — see schema below */ ]
    }
  ]
}

Language rules

Replace + validation semantics

Block schema

FieldTypeRequiredDescription
idstringRequiredStable, non-empty (e.g. a UUID).
langstringRequiredA tenant-enabled, lowercase language code (see above).
titlestringOptionalHeading shown above the grid, in `lang`.
section1 | 2 | 3 | 4RequiredPage zone the block renders into.
ordernumberRequiredSort order within (section, lang).
columnsinteger 1–8RequiredElements per row; the list wraps into rows.
is_activebooleanRequiredfalse hides the block without deleting it.
elementsBlockElement[]RequiredOrdered elements, ≤ 24 per block.

Element schema

Every element has id (non-empty string) and kind ("image" | "video" | "3d" | "text"), plus:

FieldTypeRequiredDescription
mediaobjectOptionalRequired for image/video/3d. { url, cdn_key?, is_external_link?, alt? }. Forbidden on text.
media.urlstringRequiredNon-empty safe URL: http(s) absolute or site-relative '/…'. No javascript:/data:/'//'.
textstringOptionalRequired for kind 'text' (non-empty). Forbidden on media kinds.
descriptionstringOptionalOptional caption in the block's lang.
linkobjectOptionalOptional { href (safe URL), new_tab (boolean) } wrapping the element.

Limits: ≤ 20 blocks per product, ≤ 24 elements per block.

Example

{
  "id": "blk-hero-it",
  "lang": "it",
  "title": "Caratteristiche",
  "section": 1,
  "order": 0,
  "columns": 2,
  "is_active": true,
  "elements": [
    {
      "id": "el-img-1",
      "kind": "image",
      "media": { "url": "https://cdn.example.com/p/feature-1.jpg", "alt": "Dettaglio" },
      "link": { "href": "https://www.example.com/scheda", "new_tab": true }
    },
    { "id": "el-txt-1", "kind": "text", "text": "Materiali ad alta resistenza." }
  ]
}