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 |
- 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
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 });