[PAGES-175] Create area nodes when editing a SPA Created: 01/Apr/19 Updated: 07/Feb/24 Resolved: 13/Aug/19 |
|
| Status: | Closed |
| Project: | Magnolia pages module |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Story | Priority: | Major |
| Reporter: | Christopher Zimmermann | Assignee: | Unassigned |
| Resolution: | Won't Do | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| 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
|
||||||||||||||||
| Date of First Response: | |||||||||||||||||
| Epic Link: | SPA Editor | ||||||||||||||||
| Sprint: | SPA Editor 1 | ||||||||||||||||
| Story Points: | 2 | ||||||||||||||||
| Description |
|
First goal: checkout minimal project, verify behavior, try to come up with proper autoGeneration. User story:
Notes: Area nodes are not created for templates which do not include the 'area' directive in the template script. It is not enough to define the areas in template definition. Acceptance criteria:
For additional rationale and information: https://documentation.magnolia-cms.com/display/DOCS61/SPA+genesis#SPAgenesis-WhyandwhenshouldAreaNodesbecreated
|
| Comments |
| Comment by Christopher Zimmermann [ 09/Apr/19 ] |
|
There is a mechanism for autogeneration of components. But as far as I can tell - there is no facility to autocreate area nodes, without autocreating component nodes, which is not what we want here. (https://documentation.magnolia-cms.com/display/DOCS57/Area+definition) |
| Comment by Christopher Zimmermann [ 09/Apr/19 ] |
|
I tried to get autogeneration going on a page template definition going, but there was no noticible difference in behaviour. AKA it did not work.
templateScript: /atlaskit/templates/pages/standard.ftl
renderType: freemarker
visible: true
title: Atlaskit Standard Page
class: info.magnolia.module.jsmodels.rendering.JavascriptTemplateDefinition
modelPath: /atlaskit/templates/common/definition-extractor-model.js
autoGeneration:
content:
tester:
nodeType: mgnl:area
templateId: atlaskit:components/list-with-div
generatorClass: info.magnolia.rendering.generator.CopyGenerator
areas:
main:
renderType: freemarker
type: list
templateScript: /atlaskit/templates/list-with-div.ftl
availableComponents:
title:
id: atlaskit:components/page-title
|
| Comment by Mikaël Geljić [ 09/Apr/19 ] |
|
where does the tester name come from? |
| Comment by Christopher Zimmermann [ 10/Apr/19 ] |
|
I tried using the name of the area (In a new testcaset) "left", and removing a templateId. But still no success. You can see the definition here: https://github.com/magnolia-community/react-area51-alpha/blob/autogenerate/mag-aliens-demo/light-modules/react-aliens/templates/pages/standard.yaml |
| Comment by Robert Šiška [ 15/Jul/19 ] |
|
autoGeneration definition is indeed only meant for components. Whether the area node is auto-generated or not is decided by createAreaNode (true by default) and the actual creation is done when the freemarker renderer encounters the [@cms.area] directive, which it never will in case of react's Virtual DOM... One solution to this would be a custom render that would create the area nodes pro-actively, or somehow create them dynamically from the page editor. |
| Comment by Mikaël Geljić [ 13/Aug/19 ] |
|
Closing as Won't do for now: as opposed to auto-generation, we may no longer create JCR content on the fly, upon mere delivery requests. Instead, we expect the SPA and/or Magnolia helpers to deal with absence of area nodes gracefully. |