Skip to content

Configuration reference

This page covers all plugin settings, the custom block entity field glossary, and the ACL permission structure.

Plugin settings

These settings are configured in Extensions > My extensions > CMS Block Builder > Configure (or via the Shopware admin system configuration).

Plugin configuration page showing defaultCategory and maxColumnsPerRow settings

CMS Block Builder

SettingTypeDefaultDescription
defaultCategory — Default category for new blockssingle-selectcustomOptions: custom (Custom), text-image (Text & Image), commerce (Commerce), video (Video).
maxColumnsPerRow — Maximum columns per rowint6The maximum number of columns a merchant can add to a single row in the block composer.

Entity: ssd_custom_block

Each custom block is stored as one row in this entity. The entity is translatable — the label field stores per-language display names.

FieldTypeRequiredDescription
idUUID (binary 16)YesPrimary key. Generated automatically.
technicalNamestringYesUnique identifier used as the CMS block type (ssd-custom-<technicalName>). Immutable after creation.
labelstring (translatable)YesHuman-readable display name shown in the CMS block picker.
categorystringYesCategory group in the block picker. One of: custom, text-image, commerce, video, or any other category present in the Shopware block registry.
gridConfigJSONYes12-column CSS Grid area definitions per breakpoint. See data model below.
slotsJSONYesSlot-ID-to-element-type mapping. Keys are area IDs from gridConfig; values are { type, config } objects.
previewMediaIdUUID (FK to media)NoOptional preview image shown in the block picker.
positionintNoSort order within a category in the block picker. Default: 0. Lower values appear first.
activeboolNoWhether the block is registered in the block picker. Default: true.
createdAtdatetimeYesSet automatically on creation.
updatedAtdatetimeNoUpdated automatically on save.

Translation entity: ssd_custom_block_translation

FieldTypeDescription
ssd_custom_block_idUUIDFK to ssd_custom_block.
language_idUUIDFK to language.
labelstringTranslated display name for this block.

gridConfig data model

json
{
  "columns": 12,
  "gridRows": 4,
  "breakpoints": {
    "desktop": {
      "areas": [
        { "id": "slot-0", "rowStart": 0, "colStart": 0, "rowEnd": 1, "colEnd": 6 },
        { "id": "slot-1", "rowStart": 0, "colStart": 6, "rowEnd": 1, "colEnd": 12 }
      ]
    },
    "tablet": { "areas": [] },
    "mobile": { "areas": [] }
  }
}
  • columns — always 12. The grid is a fixed 12-column CSS Grid.
  • gridRows — number of rows in the grid canvas. Minimum 1.
  • breakpoints.desktop.areas — the authoritative layout. Each area has a slot id, zero-based rowStart/rowEnd/colStart/colEnd in CSS Grid terms.
  • breakpoints.tablet.areas / breakpoints.mobile.areas — optional independent layouts. Empty arrays mean the desktop layout is used as a fallback at that breakpoint.

slots data model

json
{
  "slot-0": { "type": "image", "config": {} },
  "slot-1": { "type": "text", "config": {} }
}

Keys are area IDs from gridConfig.breakpoints.desktop.areas. The type value is the Shopware CMS element type name (e.g. text, image, product-slider). The config object holds element-level defaults (currently unused; element configuration is stored in the CMS page data).


ACL permissions

The plugin registers a permission group called CMS Block Builder under the Content category in Shopware's role management.

RolePrivileges grantedDependencies
ssd_custom_block.viewerssd_custom_block:read, ssd_custom_block_translation:read, media:read, cms_block:readNone
ssd_custom_block.editorssd_custom_block:update, ssd_custom_block_translation:update/create/delete, media:create/updateviewer
ssd_custom_block.creatorssd_custom_block:create, ssd_custom_block_translation:createviewer, editor
ssd_custom_block.deleterssd_custom_block:delete, cms_block:read, cms_section:read, cms_page:readviewer

Assign these roles in Settings > System > User management > Roles. A typical content editor needs viewer + editor. A content manager also needs creator. Only administrators should have the deleter role.


Storefront rendering

The plugin overrides cms-section-block-container.html.twig to intercept any block whose type starts with ssd-custom-. For those blocks it renders cms-block-ssd-custom-block.html.twig, which:

  1. Reads the ssdCustomBlock extension attached by CustomBlockRegistrationSubscriber at page load time.
  2. Builds three CSS Grid containers — desktop, tablet, and mobile — each positioned using grid-column and grid-row inline styles from the area definitions.
  3. Includes the standard Shopware CMS element template for each slot.

Responsive switching is handled in base.scss using Bootstrap's media-breakpoint-down() mixins: the desktop grid is shown by default; the tablet grid replaces it at ≤ md; the mobile grid replaces both at ≤ sm.


Block registration flow

At runtime the plugin follows this sequence to make custom blocks available in the CMS editor:

  1. CustomBlockCmsSubscriber listens to GenericPageLoadedEvent and attaches active blocks to the page as a ssdCustomBlocks extension.
  2. CustomBlockRegistrationSubscriber listens to CmsPageLoadedEvent and attaches the matching gridConfig and slots to each ssd-custom-* block on the page as a ssdCustomBlock extension.
  3. On the admin side, ssd-cms-block-registry.js overrides sw-cms-sidebar and calls cmsService.registerCmsBlock() for each active block fetched from the API, making them available in the block picker.

Your Vision. Signed, Sealed, Delivered.