내 커뮤니티 업적 표시줄을 확대합니다.

Submissions are now open for the 2026 Adobe Experience Maker Awards.
해결됨

nested navigation as json using content fragments

Avatar

Level 7

Hi,

 

criteria: provide navigation data as json to other front end applications.

 

Here is sample navigation I am looking to generate

sreenu539_0-1712098483866.png

sreenu539_1-1712098590016.png

 

I have below structure to generate navigation menu up to 3 levels.

Navigations structure:

  •     name (top menu item)
  •     isActive
  •     description 
  •     link (sub menu link href)
  •     linklabel (sub menu link label)

 

sub menu can have other nested sub menus.

 

How can I achieve this using content fragments ? It seems "fragment reference" only outputs the cf path rather than data of fragment referred. I do not see any "nested multifield" support for content fragments.

 

 

Thanks,

Sri

 

주제

토픽은 커뮤니티 콘텐츠를 분류하여 관련성 있는 콘텐츠를 찾는 데 도움이 됩니다.

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Community Advisor

You can utilize GraphQL to read Content Fragment data, including the ability to retrieve referenced data.

query {
  articleList { // Article Content Fragment
    items {
      title
      author { // Author Content Fragment
        _path
        name
      }
    }
  }
}

https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/headless/graphql...

 

Mahedi Sabuj

MS-29LinkedIn

원본 게시물의 솔루션 보기

5 답변 개

Avatar

Level 2

You could create a custom endpoint at server-side to read the reference fragments data and add it in JSON response.

Avatar

정확한 답변 작성자:
Community Advisor

You can utilize GraphQL to read Content Fragment data, including the ability to retrieve referenced data.

query {
  articleList { // Article Content Fragment
    items {
      title
      author { // Author Content Fragment
        _path
        name
      }
    }
  }
}

https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/headless/graphql...

 

Mahedi Sabuj

MS-29LinkedIn

Avatar

Community Advisor

Hi @sreenu539 

Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.

Arun Patidar

AEM LinksLinkedIn

Avatar

Community Advisor

@sreenu539 

 

This would need customization. Just like Navigation Sling Model derives information from pages, we would need to derive information from CF hierarchy.

 

Other choice is to use GraphQL (preferred option), since an external application needs this data. Please review queries on: https://experienceleague.adobe.com/en/docs/experience-manager-learn/getting-started-with-aem-headles...

 

 


Aanchal Sikka

Avatar

Administrator

@sreenu539  Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.



Kautuk Sahni