[PAGES-1308] AreaNodeHelper class getTemplateDefinition method does not consider the site template/prototype Created: 30/Aug/23 Updated: 25/Oct/23 Resolved: 20/Sep/23 |
|
| Status: | Closed |
| Project: | Magnolia pages module |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Neutral |
| Reporter: | Riste Drangovski | Assignee: | Dai Ha |
| Resolution: | Duplicate | 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)
|
||||||||
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
||||||||
| Date of First Response: | |||||||||
| Epic Link: | Support | ||||||||
| Team: | |||||||||
| Description |
|
info.magnolia.rendering.spa.renderer.AreaNodeHelper#getTemplateDefinition supposed to get the template definition for a node. Basically that works, but it does not consider the site template/prototype. So if an area is defined in <Light Module>/template/pages/page.yaml, it is picked up correctly. But if the area is defined in <Site>/templates/prototype/areas/, it is not picked up. |
| Comments |
| Comment by Christopher Zimmermann [ 30/Aug/23 ] |
|
Hmmm. Not sure of the specifics of the problem here. But I know that I have used a site protoype to define an area on a spa project and it worked. That is, the area was configured and working correctly. (Maybe it is necessary for the prototype to be defined in YAML (rather than in JCR?)) Maybe this example helps: https://docs.magnolia-cms.com/headless/spa-development/SPA-hosting.html#_site_aware_external_spa |
| Comment by Dai Ha [ 31/Aug/23 ] |
|
I would agree with Topher, AreaNodeHelper creates area nodes in spa context, and it is called inside template endpoints. If it is a site related page, it should be configured to use site spa when the overload AreaNodeHelper#createAreaNodes(javax.jcr.Node, java.util.Optional<info.magnolia.rendering.template.TemplateDefinition>, boolean) will take a "complete TemplateDefinition" from SiteAwareTemplateAnnotationEndpoint. |
| Comment by Dai Ha [ 31/Aug/23 ] |
|
Link this problem with |
| Comment by Christopher Zimmermann [ 04/Sep/23 ] |
|
rdrangovski Hey Riste - any thoughts on the above? Would be great if you can share what you are hoping to achieve / usecase. |
| Comment by Riste Drangovski [ 05/Sep/23 ] |
|
Hi guys, Regards, |
| Comment by Christopher Zimmermann [ 05/Sep/23 ] |
|
Thanks |
| Comment by Christopher Zimmermann [ 06/Sep/23 ] |
|
We wait for more input on the use case. |
| Comment by Jochen Klein [ 18/Sep/23 ] |
|
Hi, I am 'the BASF' guy What we are tying to do is the following: We have a page footer, hat is on every page. The footer in configured on the home page and the inherited onto every descendent page. As far as I can see, all of that is tackled in The PR also shows, how we can reuse the functionality (TempalteDefinitionHelper) in our code, which controls the inheritance / redefinition of the area. |
| Comment by Dai Ha [ 18/Sep/23 ] |
|
Thanks jaklein for your reply. Indeed with |
| Comment by Dai Ha [ 20/Sep/23 ] |
|
Close as duplicated with |