[MGNLMULTPA-53] fragmentsfn templating function should support nested areas Created: 29/Nov/23  Updated: 13/Dec/23  Resolved: 13/Dec/23

Status: Closed
Project: Multiple Pages Apps
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Anh Vu Assignee: Rishab Dhar
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File image-2023-11-29-13-26-07-327.png     PNG File image-2023-11-29-13-26-57-123.png     PNG File image-2023-11-29-13-27-57-015.png     PNG File image-2023-11-29-13-29-29-684.png    
Issue Links:
relation
is related to MGNLMULTPA-35 Create fragmentsfn templating function Closed
Template:
Acceptance criteria:
Empty
Date of First Response:
Epic Link: Multiple Pages App LD
Team: DeveloperX
Work Started:

 Description   

Currently if the main area of a banner has nested areas, the app cannot show the banner from another pages app.

Steps to reproduce:
1. Create a page template which has nested areas

2. Create a banner with the page template from Banner app

3. In Pages app, create a page and add a banner component to link to the banner from step 2

Expected result: Banner component should show the linked banner correctly
Actual result: Banner component cannot show the linked banner

To reproduce we can use the demo: https://git.magnolia-cms.com/users/czimmermann/repos/page-fragments-demo/browse?at=refs%2Fheads%2Fuse-fragmentfn

Note: Consider the case an area has a component that has areas as well when fixing the bugs.



 Comments   
Comment by Christopher Zimmermann [ 01/Dec/23 ]

Just a guess - could the ```fragmentfn.getMainArea(fragmentNode)]``` maybe not retrieving the full tree under a node - but only a depth of 1 or something?

It would also be good to test with a component in the fragment which has subnodes - such as if it contains a multifield or compositefielld or switchfield.

Comment by Rishab Dhar [ 13/Dec/23 ]

In case of nested areas, when using templateScript, the rendering of the nested components needs to be handled in the referenced templateScript.

[#list components as component ]
   [@cms.component content=component /]
[/#list]
Generated at Mon Feb 12 10:21:13 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.