Skip to content

Latest commit

 

History

History
29 lines (28 loc) · 913 Bytes

2023-10-18-fix-that-multiple-instances-of-same-cms-element-from-app-sdk-are-not-working.md

File metadata and controls

29 lines (28 loc) · 913 Bytes
title issue author author_email author_github
Fix that multiple instances of same CMS element from app sdk are not working
NEXT-25102
Jannis Leifeld
j.leifeld@shopware.com
Jannis Leifeld

Administration

  • Added unique data key for CMS elements so that each single element can have unique configuration values. The value is accessible within the query parameter elementId from the iFrame

Upgrade Information

Use new key inside app CMS elements

change in app iFrame this

data.subscribe(
    'your-cms-element-name__config-element',
    yourCallback,
{ selectors: yourSelectors });

to

const elementId = new URLSearchParams(window.location.search).get('elementId');

data.subscribe(
    // add elementId to data key for identifying the correct element config
    'your-cms-element-name__config-element' + '__' + elementId,
    yourCallback,
{ selectors: yourSelectors });