Use Experience Fragments in AEM Content Components | Community
Skip to main content
Level 2
Jul 10, 2018 7:14 AM UTC

Use Experience Fragments in AEM Content Components

Hello,

We are using AEM 6.3

Problem Statement:

1. I have a content component - "Hero" on an AEM page - home.html

2. Hero component browses Panel component pages - which means, AEM page with Panel Content Component.

home.html (with Hero) -> panel1.html

                                     -> panel2.html

Problem is how to use experience fragments here for #2.

Proposed Solution:

Instead of using individual AEM pages for Panel component.

Use experience fragments instead.

My Attempt:

1. I created one experience fragment with Panel component.

2. Tried to use in home1.html , home2.html

Issue where I got stuck:

1. How do I associate Hero component and the experience Fragment component. These will be added as 2 individual components on home.html?How will Hero component get data from Panel components? There could be multiple other Experience Fragments components. How could I associate one experience fragment component to Hero component?

2. As far as I know, I cannot break inheritance of experience fragments in AEM 6.3.  My problem is if experience fragment -"ex-panel1" is used on home1.html and home2.html. But in home2.html, the image I want to use a different one, rest of data I can re-use as-is.  I will update ex-panel1 in home2.html alone with new image. Is this the recommended approach? I see things are working fine but just wanted to get a confirmation since I read breaking inheritance in experience fragments is an option only from AEM 6.4.

Thanks,

Sudha.

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

15 replies

smacdonald2008
Level 10
Jul 10, 2018 3:10 PM UTC

In your Sling Model code of the component - what Java API you using to gather the data?

Translate
Level 2
Jul 10, 2018 3:06 PM UTC

Yes JCR Data.

1. What I am doing currently is.

2. Hero component browses say 2 panel page paths.

3. Each of these components have their respective Sling Models.

4. In Sling Model of Hero, I get the Panel Path that is browsed get the sling model of Panel component and finally return the JSON from Hero component.

Translate
smacdonald2008
Level 10
Jul 10, 2018 2:28 PM UTC

WHen you say get data - are you talking about JCR data?

Translate
Level 2
Jul 10, 2018 9:20 AM UTC

I will land into same issues with variations as well right.

Translate
arunpatidar
New Participant
Jul 10, 2018 7:57 AM UTC

Hi,

If you need variations in XF, you can go for variations.

Adobe Experience Manager Help | Understanding AEM Experience Fragments

Thanks

Arun

Translate
Arun Patidar