[MGNLREST-211] Produce page-editor-hints Created: 16/May/19  Updated: 18/Nov/19  Resolved: 05/Nov/19

Status: Closed
Project: Magnolia REST Framework
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Story Priority: Neutral
Reporter: Christopher Zimmermann Assignee: Robert Šiška
Resolution: Obsolete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to MGNLREST-201 Get templateDefinitions from OOTB RES... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Release notes required:
Yes
Documentation update required:
Yes
Date of First Response:
Epic Link: SPA Editor
Sprint: SPA Editor 7, SPA Editor 8, SPA Editor 9
Story Points: 5

 Description   

User story:
As a frontend developer, I want to get page-editor-hints (html comments) from Magnolia, so that I can render them in my React app so that the page editor will create the green edit bars with the correct behaviour.

Notes:
Creating the editor hints in the code of a SPA is difficult, and could result in bugs if Magnolia changes the format of them in a future version. For example, activationStatus is calculated. If developers can get the editor-hints via a official supported API it will make SPA integrations easier and less error-prone.
Requested from Argos and Car Glass.

Acceptance criteria:

  • REST API to get page-editor-hints for a page (and its area and components), or for an entire subtree of the website workspace.
  • API could deliver either complete HTML comment, or a JSON map of its properties.

Suggestion:
It could be convenient to add this as a feature to the existing Delivery API, so that each returned area and component would have a subnode with the page-editor-hint.

Example page-editor-comment for an area:

<!-- cms:area 
content="website:/travel/about" 
name="navigation" 
availableComponents="" 
type="noComponent" 
label="Navigation" 
inherit="false" 
optional="false" 
created="false" 
createdAreaNode="false" 
showAddButton="false" 
showNewComponentArea="false" 
activationStatus="2" 
-->


 Comments   
Comment by Bartosz Staryga [ 04/Jul/19 ]

It would be nice if existed delivery API was extended with the relevant comment, eg:

"main": {    
  ...
  "@name": "main",    
  "mgnl:editorHints": {      
    "before": "<!-- cms:area ... -->",      
    "after": "<!-- /cms:area -->"    
  } 
  ...
}

 

 

Generated at Mon Feb 12 06:57:43 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.