Details
-
Story
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
None
-
None
Description
Goal: get the SPA demos to work as-is, but without cms-js-overrides.js.
Idea:
- the SPA defines window.SPA:
window.SPA = { init: (cms) => { ... } renderComponent: () => { ... } }
- SPA waits until Channel Manager calls window.SPA.init()
- Channel Manager calls window.SPA.init() with a single argument: a JavaScript object with the JavaScript CMS API:
{ createOverlay(); syncOverlay() }
- SPA adds HTML comments from the backend model to the DOM
- SPA calls cms.createOverlay()
- the SPA can optionally call cms.syncOverlay() to sync the overlay positions, if needed.
- Channel Manager calls window.SPA.renderComponent whenever the SPA needs to re-render a component
- When a user adds a component to a container, the Channel Manager reloads the whole page automatically when window.SPA is present so the whole SPA reinitializes and eventually calls cms.createOverlay() again with the updated containers. Same for deleting and moving a component.
Attachments
1.
|
Analyze page via API call | Closed | Unassigned | |
2.
|
Re-render components via API call | Closed | Unassigned | |
3.
|
Reload SPA when component is moved or added | Closed | Unassigned |