Communication Data Type
The communication data type is set an HTML element inside the AEM Page component using the data-cq-datatype attribute. When the communication data type is set to JSON, the GET requests hit the Sling Model endpoints of a component. After an update occurs in the page editor, the JSON representation of the updated component is sent to the Page Model library. The Page Model library then warns the SPA of updates.
SPA Page Component - body.html
In addition to being good practice not to delay the DOM generation, the SPA framework requires the scripts to be added at the end of the body.
SPA Page Component -customfooterlibs.html
The meta resource properties that describe the SPA content:
SPA Page Component - customheaderlibs.html
Meta Properties
cq:wcmmode: WCM mode of the editors (for example, page, template)cq:pagemodel_root_url: URL of the root model of the App. Crucial when directly accessing a child page since the child page model is a fragment of the app root model. ThePageModelManagerthen systematically recomposes the application initial model as entering the application from its root entry point.cq:pagemodel_router: Enable or disable theModelRouterof thePageModelManagerlibrarycq:pagemodel_route_filters: Comma separated list or regular expressions to provide routes theModelRoutermust ignore.
Page Editor Overlay Synchronization
The synchronization of the overlays is guaranteed by the very same Mutation Observer provided by the cq.authoring.page category.
Sling Model JSON Exported Structure Configuration
When the routing capabilities are enabled, the assumption is that the JSON export of the SPA contains the different routes of the application thanks to the JSON export of the AEM navigation component. The JSON output of the AEM navigation component can be configured in the SPA’s root page content policy through the following two properties:
structureDepth: Number corresponding to the depth of the tree exportedstructurePatterns: Regex of array of regexes corresponding to the page to be exported
Was this content helpful?
Announcements
Get hands-on with agentic AI.
Explore how AI agents work together through real examples and hands-on practice. Join your local User Group to design an agent workflow with your peers and leave with a practical framework you can apply to your own work.
Find an event