Uploaded image for project: '[Read Only] - Addon Channel Manager'
  1. [Read Only] - Addon Channel Manager
  2. CHANNELMGR-1705

[SPA++] Public JS API Support for SPA to parse page and render components

    XMLWordPrintable

Details

    • Story
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • 5.3.0
    • 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

        Activity

          People

            Unassigned Unassigned
            wko Woonsan Ko (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: