refer content fragment in another content fragment | Community
Skip to main content
sreenu539
Level 7
April 8, 2022
Solved

refer content fragment in another content fragment

  • April 8, 2022
  • 2 replies
  • 1426 views

Hi,

Environment: AE, 6.5.7

Core components: 2.12.2

 

I am trying below content reference type to refer other content fragments in a content fragment

 

 

when I do http://localhost:4502/api/assets/core-components-examples/library/primary.json

Following is the result, I was expecting .json will result in referenced content fragment text as well but it is displaying path of content fragment.

 

 

When I use content fragment on a page , content reference path is displayed not text authored inside content fragment.

 

 

Is there something I am missing here? 

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by ibishika

No, that is the normal behaviour. If you want the json from the child content fragment, you will have to write a custom Sling Model Exporter for Content Fragment I believe.

2 replies

ibishika
ibishikaAccepted solution
Level 4
April 9, 2022

No, that is the normal behaviour. If you want the json from the child content fragment, you will have to write a custom Sling Model Exporter for Content Fragment I believe.

Shashi_Mulugu
Community Advisor
Community Advisor
April 14, 2022

@sreenu539 As @ibishika it is default behavior of any nested reference of resources,  it could be page,asset or content fragments.

 

If you want inner/nested fragments in json, using sling model exporter for parent content fragment and pull inner fragment as object instead of path.

 

If you want in page, you have to write similar custom logic in component sling model