Skip to main content
Version: Next

Headless Bricks

Headless Bricks allow the configuration of a reusable set of editables that can be used in Headless Documents with the Areablock editable.

The functionality is similar to the Areablocks of the default Pimcore documents, as Headless Bricks are an extension of Pimcore area-bricks. The difference is that you don't need to define a brick class to register brick on the system and use it on the document. Instead, just define brick structure via a yaml structure and reference it in headless templates.

Brick Configuration Interface:

Headless Brick Configuration InterfaceHeadless Brick Configuration InterfaceHeadless Brick Configuration Interface

Bricks configuration example in Symfony configuration file: var/config/headless_bricks/teasers.yaml

pimcore_headless_documents:
bricks:
teasers:
type: brick
items:
teaser_1:
type: snippet
teaser_2:
type: snippet
gallery:
type: brick
icon: '/bundles/pimcoreadmin/img/flat-color-icons/like.svg'
group: 'Gallery'
items:
image:
type: image
config:
width: 200
height: 200
thumbnail: gallery

Bricks usage example in headless template configuration: var/config/headless_templates/example.yaml

pimcore_headless_documents:
templates:
example:
content:
contentBlocks:
type: areablock
config:
allowed: ['teasers', 'gallery']