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

Experience Fragment issue for AMP page.

Avatar

Avatar
Level 1
mdh72917186
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile

Avatar
Level 1
mdh72917186
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile
mdh72917186
Level 1

20-05-2020

Hi,

I am trying to implement the experience fragment for AMP page. I have converted all core components to be AMP compatible by creating amp.html which is overriding the core components html. This amp.html is invoked with the amp selector in page URL. When an Experience fragment load on an amp page its not loading the amp.html rather loading the core components html which makes that amp page invalid. The body.js invoked in core xfpage component invoke core component html rather than amp.html. 

 

Experience fragment is loading from OOTB /libs/cq/experience-fragments/components/xfpage  which invokes the body.js (/libs/cq/experience-fragments/components/xfpage/body.js) and Amp does not allow JS.

 

I need my experience fragment to load amp.html on amp pages. So I need help to load xfpage and core component as Amp valid.

@smacdonald2008 

@kautuk_sahni 

@Arun_Patidar 

@Veena_Vikram 

AEM AMP Experience Fragments

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,115 likes

Total Posts

3,149 posts

Correct Reply

1,072 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,115 likes

Total Posts

3,149 posts

Correct Reply

1,072 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile
Jörg_Hoh
Employee

21-05-2020

AMP support for core components have been added already (see https://github.com/adobe/aem-core-wcm-components/pull/861), so I don't think that there is a need to build it on your own (unfortunately no version number is given for that PR, but should be part of the latest release already, please double-check).

 

To your question: The page rendering must hand down the "amp" selector to any component. Depending on how much you customized you have to do it either yourself (adapting the <cq:include> tag or its HTL pendant) or see that the product components do it. It would assume that with the adapted core component you are better off. Maybe they have taken a different approach though.

 

 

 

 

Answers (0)