Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Use Experience Fragments in AEM Content Components

Avatar

Avatar
Validate 1
Level 2
sudhag73425455
Level 2

Likes

6 likes

Total Posts

29 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile

Avatar
Validate 1
Level 2
sudhag73425455
Level 2

Likes

6 likes

Total Posts

29 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile
sudhag73425455
Level 2

10-07-2018

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.

Replies

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,348 likes

Total Posts

3,226 posts

Correct Reply

916 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,348 likes

Total Posts

3,226 posts

Correct Reply

916 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

10-07-2018

Hi,

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

Adobe Experience Manager Help | Understanding AEM Experience Fragments

Thanks

Arun

Avatar

Avatar
Validate 1
Level 2
sudhag73425455
Level 2

Likes

6 likes

Total Posts

29 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile

Avatar
Validate 1
Level 2
sudhag73425455
Level 2

Likes

6 likes

Total Posts

29 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile
sudhag73425455
Level 2

10-07-2018

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

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

10-07-2018

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

Avatar

Avatar
Validate 1
Level 2
sudhag73425455
Level 2

Likes

6 likes

Total Posts

29 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile

Avatar
Validate 1
Level 2
sudhag73425455
Level 2

Likes

6 likes

Total Posts

29 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile
sudhag73425455
Level 2

10-07-2018

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.

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

10-07-2018

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

Avatar

Avatar
Validate 1
Level 2
sudhag73425455
Level 2

Likes

6 likes

Total Posts

29 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile

Avatar
Validate 1
Level 2
sudhag73425455
Level 2

Likes

6 likes

Total Posts

29 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile
sudhag73425455
Level 2

10-07-2018

Sling API

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

10-07-2018

Using the SLing API, are you getting the result set you need?

Avatar

Avatar
Validate 1
Level 2
sudhag73425455
Level 2

Likes

6 likes

Total Posts

29 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile

Avatar
Validate 1
Level 2
sudhag73425455
Level 2

Likes

6 likes

Total Posts

29 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile
sudhag73425455
Level 2

10-07-2018

Using experience fragments - No I am not getting. I am not sure how I use experience fragments in this use-case. Thats the #1 under issues that I described.

I have my home.html -> I added Hero component and 2 Experience Fragment Component. Each of the experience fragment components has the panel information which needs to be read in SLing Model of Hero.

How can I do that?

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

10-07-2018

Purhaps you should look at writing an HTL component that uses Sling Models and HTL code as opposed to Experience Fragments. Experience Fragments are not meant to read Java code like HTL components are.