Skip to content

Register CMS element

Register CMS element

Available since Shopware v6.4.17.0

With cms.registerCmsElement you can register CMS elements to use in the Shopping Experiences Module. More information on how to develop CMS elements can be found in this guide.

Register a CMS element in your Shopping Experiences Module via App

Usage:

ts
void cms.registerCmsElement({
    name: 'dailymotionElement',
    label: 'Dailymotion Video',
    defaultConfig: {
        dailyUrl: {
            source: 'static',
            value: '',
        },
    },
});

Parameters

NameRequiredDescription
nametrueThe name of the cms element, which will also be used to generate locationIds - Should have vendor prefix
labeltrueThe label, which is visible when selecting the cms element - Use snippet keys here!
defaultConfigtrueObject containing the defaultConfig; same like in plugin development.