SPA templating API

The templateDefinitions methods and the associated endpoint have been deprecated. Using them can lead to unexpected issues.

Please update your project to use the templateAnnotations methods and the template-annotations endpoint instead.

See it, for example, in our minimal headless SPA demos.

The template-annotations supports many features which the template-definitions does not:

  • multi-language editing

  • personalization

  • publication status of components

  • live copy

SPA template annotations endpoint

Magnolia SPA template annotations make content from a front-end project editable in Magnolia. This is achieved by injecting annotations (HTML comments) around components which the Magnolia Page editor transforms into controls for web content editors.

Annotations are created on the server and can be retrieved through a dedicated Template annotation endpoint. The advantage is the server renders everything from the attributes. Before, the annotations were created in Magnolia frontend helpers.

Version 6.2.17 of the Pages module also introduced the site-aware template annotations endpoint (, which is aware of site-defined prototype templates.

Retrieving annotations

The example below shows how you can retrieve template annotations for the Two columns page in the angular-lm light module. The light module is part of our angular-sample demonstration Angular application.

The endpoint path as well as the other environment parameters are configured in the .env configuration file:




Template annotations for the page can be retrieved through the following URL:

Page content for single-page applications is delivered through the Delivery API.

SPA template definitions endpoint

For Single-page applications, we provide a dedicated template definitions endpoint which is used to deliver page, area and component template definitions.

Its implementation class is You don’t need to configure anything in the endpoint.

Example request URL and response for template id mtk:components/textImage:

    "mtk:components/textImage": {
        "dialog": "mtk:components/textImage",
        "templateScript": "/mtk/templates/components/textImage.ftl",
        "name": "textImage",
        "id": "mtk:components/textImage",
        "type": "content",
        "renderType": "freemarker"
Page content for single-page applications is delivered through the Delivery API.




This widget lets you know where you are on the docs site.

You are currently perusing through the Headless docs.

Main doc sections

DX Core Headless PaaS Legacy Cloud Incubator modules