-
Improvement
-
Resolution: Unresolved
-
Neutral
-
None
-
None
-
None
-
None
Now for Visual SPA to work, we need to fetch extra data from `template-annotations` endpoint. It is manageable but does add extra complexity to the code.
get page content
if in magnolia
fetch template-annotations
pass data to editable page
What if we return template annotations data in the response from Delivery API?
{ "@name": "home", "@path": "/home", "templateAnnotation": ""cms:page ...", ... "main": { "@path": "/home/main", "templateAnnotation": ""cms:area ...", ... "0": { "@path": "/home/main/0", "templateAnnotation": ""cms:component ...", ... } } }
We could simplify the code to:
get page content pass data to editable page
How would Delivery API know to fetch those extra data? Query params that Magnolia already adds to iframe src.
We already do:
get page content // add all query param from page request
pass data to editable page
This is just a basic case, so it might seem simple, but it gets more tricky when we bring in the p13n and multiple workspaces (sales demo).
Currently, we must:
- define new template annotations endpoints for multiple workspaces
- ensure they use the new implementation class
- JS needs to guess if it opens in the context of Pages App or Campain App or any other app using different workspaces and chose a correct template annotations url. It changes 2 lines of code into 50
Acceptance criteria