AEM 6.3 Experience Fragments

Avatar

Avatar

suhass86991778

Avatar

suhass86991778

suhass86991778

03-10-2017

The AEM Experience Fragments can be created with pre-built templates like Html, Facebook, We-Retail. It is does not provide a design mode option to select my custom components.

https://docs.adobe.com/docs/en/aem/6-3/author/experience-fragments.html

How do I use my custom components in designing/building an experience fragment? Can I create a custom template and use it in creating an experience fragment? Or the last available option is to use a layout container and use it in creating an experience fragment.

Thanks in advance for any suggestions.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

kautuk_sahni

Community Manager

Total Posts

5.6K

Likes

961

Correct Answer

1.1K

Avatar

kautuk_sahni

Community Manager

Total Posts

5.6K

Likes

961

Correct Answer

1.1K
kautuk_sahni
Community Manager

04-10-2017

Hi,

This is really a nice question. Let me answer it 1 by 1:

How do I use my custom components in designing/building an experience fragment?

We can not this directly. As the user who is creating the Experience fragment should not be having rights to configure the allowed components.

Can I create a custom template and use it in creating an experience fragment? Or the last available option is to use a layout container and use it in creating an experience fragment.

Yes, this should be the approach.

Step1:-

We should create an Editable template "Tools> General > Templates" and therein layout container we can configure policies (here we can configure which all component groups to be included or excluded) and later use this templates for creating Experience fragment

Step2:- Enable this template and later use this templates for creating Experience fragment

Step3:- In CRX/de go to /content/experience-fragments and in cq:allowedTemplates add the path of newly created Template in step 1. Now you are good to go. Now when you create

PS:- You can avoid Step 2 and 3 and can directly use We-retail template available. Just change policy as per your need.

Tested now, working fine.

~kautuk

Answers (5)

Answers (5)

Avatar

Avatar

deepakaitha

Avatar

deepakaitha

deepakaitha

11-12-2018

I have faced the same thing that ahmedmusallam​ has faced. It ll be great if documented. Ignore this comment if already done.

kautuksahni

Avatar

Avatar

ahmedmusallam

Avatar

ahmedmusallam

ahmedmusallam

18-09-2018

oh, I see it now, it's a little button with a "cog" icon on the top right corner of http://localhost:4502/aem/experience-fragments.html/content/experience-fragments

Still my concern remains.. it is not documented.

Avatar

Avatar

umangm99

Avatar

umangm99

umangm99

18-09-2018

In AEM 6.4 this is available in Touch UI on Experience Fragment folder and from there you can add new template path.

Avatar

Avatar

ahmedmusallam

Avatar

ahmedmusallam

ahmedmusallam

15-08-2018

kautuksahni​ any updated on this? I'd really like to know how I can do this correctly. Thanks!

Avatar

Avatar

ahmedmusallam

Avatar

ahmedmusallam

ahmedmusallam

17-07-2018

kautuksahni

So I'm looking at the documentation for creating Experience Fragments And I want to create a fragment from a custom template; the same way the we-retail sample project does.

So I go about creating a template, they try to create my fragment from that template only to find that my template does not show up as one of the options... ok.. I look into how we-retail did it and I copy the web variation template to my own directory under /conf.. still not working..

At this point, I do a google search and I arrive here.. and I see you are mentioning that you need to add the location of the template to the cq:AllowedTemplates prop of the node /content/experience-fragments.

Now I have two questions:

1. Why is this not documented in the official documentation? The whole point is to be able to create your own templates and fragments, right? So the use of  cq:AllowedTemplates prop of the node /content/experience-fragments should be well documented.

2. How is the we-retail sample implementation adding the path to cq:AllowedTemplates automatically? I can see this entry added to cq:AllowedTemplates: `/conf/we-retail/settings/wcm/templates/experience-fragment(.*)?` But I dont see where in the we-retail code it's being added?

Thanks!