Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Experience Fragments and Plain HTML renditions, could use some help

Avatar

Level 2

So we have a number of experience fragments our authors have created and we want to export them as plain HTML. According to the documentation, you simply use the .plain. selector in the URL and poof it should work. This doesn't seem to work so questions:

 

1. Are you supposed to be hitting the XF directly? If so, how do you construct a URL to hit the XF directly?

2. Are you supposed to add the XF to a page and then use the selector? We tried this, but .plain. just returns the same page.

3. Are there dispatcher changes needed to do this?

 

This does feel like a fundamental gap in understanding how this works from our end, but the docs are very light here and it appears like it should "just work". Any help is appreciated.

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hello @williamkr1,

The plain selector will change the URL to the publish one. However, 'generally' the XFs are not to be accessed to the publisher as they're used to export to third party like Target directly from Author instance.

If you need to check html which is being sent to third party like Target, please use 'nocloudconfigs' selector.

By default, when you construct a Target HTML Offer, a request is sent to a custom Sling selector in AEM. This selector is called .nocloudconfigs.html . As its name implies, it creates a plain HTML rendering of an Experience Fragment, but does not include cloud configurations (which would be superfluous information).

Hope this helps!

Jineet

View solution in original post

4 Replies

Avatar

Community Advisor

Experience Fragment can be easily accessed by hitting the URL with "plain" selector for example

https://localhost:4502/content/experience-fragment/fragmentName/master.plain.html.

see ref https://docs.adobe.com/content/help/en/experience-manager-65/developing/extending-aem/experience-fra...

If still not working check logs see what error your are getting put it here.

 

Dispatcher also can block your requests you need to allow experience fragment path in filter section

 

 

 

Avatar

Community Advisor

Hi @williamkr1,

We need to use the selector "plain" to XF as below (Highlighted in bold is an XF along with plain selector in italics)

If we have references to links via src/ href /action attribute in your XF content (lets say via Image component or text with anchor tag), it will be preceded with publish instance domain and port

More about this in below:

As you have mentioned it is not working with "plain", could you please share details on your XF path and complete URL on how you are trying to access. 

Avatar

Correct answer by
Community Advisor

Hello @williamkr1,

The plain selector will change the URL to the publish one. However, 'generally' the XFs are not to be accessed to the publisher as they're used to export to third party like Target directly from Author instance.

If you need to check html which is being sent to third party like Target, please use 'nocloudconfigs' selector.

By default, when you construct a Target HTML Offer, a request is sent to a custom Sling selector in AEM. This selector is called .nocloudconfigs.html . As its name implies, it creates a plain HTML rendering of an Experience Fragment, but does not include cloud configurations (which would be superfluous information).

Hope this helps!

Jineet

Avatar

Community Advisor

Please check /libs/experience-fragments/config/rewriter/experiencefragments configuration if plain selector is enabled for the attributes. This could be the reason but not sure worth to give a try.



Arun Patidar