Shopware icon

Shopware

Shopware

Actions778

Cms Block → Update Cms Block

AI-generated

Overview

This node updates a CMS Block resource in the Shopware system. It is useful for scenarios where you need to modify existing CMS blocks, such as changing their position, type, appearance, or content structure. For example, you can update the block's name, background color, margins, visibility settings, and nested sections or slots to customize the layout and presentation of a CMS page.

Use Case Examples

  1. Updating the position and type of a CMS block to reorganize page layout.
  2. Changing the background color and media of a CMS block to match a new theme.
  3. Modifying the visibility settings of a CMS block to control its display on different sales channels.

Properties

Name Meaning
Id Identifier for the cms_block, required to specify which block to update.
Response Data format for response, used as a query parameter to specify response format.
Position The position of the CMS block within its section.
Type The type of the CMS block, defining its behavior or layout.
Locked Boolean flag indicating if the CMS block is locked from editing.
Name Name of the CMS block.
Section Position Position of the section containing the CMS block.
Margin Top Top margin CSS value for the CMS block.
Margin Bottom Bottom margin CSS value for the CMS block.
Margin Left Left margin CSS value for the CMS block.
Margin Right Right margin CSS value for the CMS block.
Background Color Background color CSS value for the CMS block.
Background Media Id Identifier for the background media asset.
Background Media Mode Mode setting for how background media is displayed.
Css Class CSS class names applied to the CMS block.
Visibility JSON object defining visibility rules for the CMS block.
Section Id Identifier of the section the CMS block belongs to.
Custom Fields JSON object for custom fields associated with the CMS block.
Version Id Version identifier for the CMS block.
Cms Section Version Id Version identifier for the CMS section containing the block.
Created At Timestamp of when the CMS block was created.
Updated At Timestamp of when the CMS block was last updated.
Section JSON object representing the section structure containing the CMS block.
Background Media JSON object representing the background media details.
Slots JSON array representing the slots within the CMS block, which may contain nested blocks and content.

Output

JSON

  • id - The unique identifier of the updated CMS block.
  • position - The position of the CMS block within its section.
  • type - The type of the CMS block.
  • locked - Indicates if the CMS block is locked.
  • name - The name of the CMS block.
  • sectionPosition - Position of the section containing the CMS block.
  • marginTop - Top margin CSS value.
  • marginBottom - Bottom margin CSS value.
  • marginLeft - Left margin CSS value.
  • marginRight - Right margin CSS value.
  • backgroundColor - Background color CSS value.
  • backgroundMediaId - Identifier for the background media asset.
  • backgroundMediaMode - Mode for displaying background media.
  • cssClass - CSS class names applied to the block.
  • visibility - Visibility rules as a JSON object.
  • sectionId - Identifier of the section the block belongs to.
  • customFields - Custom fields as a JSON object.
  • versionId - Version identifier of the block.
  • cmsSectionVersionId - Version identifier of the containing CMS section.
  • createdAt - Creation timestamp.
  • updatedAt - Last update timestamp.
  • section - Section structure as a JSON object.
  • backgroundMedia - Background media details as a JSON object.
  • slots - Slots within the block as a JSON array.

Troubleshooting

  • Ensure the 'Id' property is provided and correctly identifies an existing CMS block to update.
  • Verify that required properties like 'Position', 'Type', and 'Section Id' are set to valid values.
  • If using JSON properties like 'Visibility', 'Custom Fields', 'Section', 'Background Media', or 'Slots', ensure the JSON is well-formed and correctly parsed.
  • Check API credentials and endpoint URL configuration to avoid authentication or connection errors.

Discussion