Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: MGNLFE-22 (polish edit)

...

Excerpts from: https://git.magnolia-cms.com/projects/DEMOS/repos/minimal-headless-spa-demos/.

Info

To create

...

a mapping, the important thing is the Magnolia template id of the template, a combination of the module name

...

and

...

tthe emplate path.

For this the following template definition, the Magnolia template id is spa-lm:components/headline

Code Block
languageyml
title/magnolia/light-modules/spa-lm/templates/components/headline.yaml
title: Headline
dialog: spa-lm:components/headline

...

Additionally, to set the mappings, setComponentMapping() must be called on the EditorContextService:

Code Block
languagejs
title/spa/angular-minimal/src/app/root.comonent.ts
this.editorContext.setComponentMapping(config.componentMapping);

...

Additionally, to set the mappings, the config object must be passed through the config argument of the<EditablePage/component> component:

Code Block
languagejs
title/spa/react-minimal/src/app/helpers/PageLoader.js
import config  from '../magnolia.config';
...
<EditablePage templateDefinitions={templateDefinitions} content={content} config={config}>