How to create Experience Fragments Template?

Avatar

Avatar

chirran414

Avatar

chirran414

chirran414

08-11-2018

Hello Everyone,

Is there any tutorial or any documentation on how to create an Experience Fragments template as in the following screenshot. (Those are given Templates to use in order to create an experience fragments). If we want to create our own project specific templates how to create it? Can anyone point me in right direction to achieve this?

Like Editable templates, can we create a multiple Experience Fragments Templates or just we use only one?

Screen Shot 2018-11-08 at 11.02.57 AM.png

Thanks,

Narayana

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Arun_Patidar

MVP

Total Posts

2.9K

Likes

1.0K

Correct Answer

831

Avatar

Arun_Patidar

MVP

Total Posts

2.9K

Likes

1.0K

Correct Answer

831
Arun_Patidar
MVP

09-11-2018

You can create XF template similar to page template and add new template in cq:allowedTemplates property at /content/experience-fragments

Answers (9)

Answers (9)

Avatar

Avatar

chirran414

Avatar

chirran414

chirran414

12-11-2018

Hi Arun,

If we do like that we would see our newly created template under Experience Fragments from the Global Navigation and it would act as a normal editable template. But when we look at the We-Retail project it has following changes as well. 1. xfPage page component and they did changed the sling:resourceType pointing to xfPage page component.

xfpage, resourcetype.png

Then only we would see this Variation icon.

Variations option.png

Add to your point, I think after creating the normal editable template using empty-page template type, then allowing this path under /content/experience-fragments allowedTeplate property we also need to do these 2 changes as well I think. If you have any idea about this?.

Avatar

Avatar

Rajalakshmi

Avatar

Rajalakshmi

Rajalakshmi

06-11-2020

Hi @Arun_Patidar  can we able to create Experience Fragements using a static template and add that Xf to a page created using static template?.

 

Thanks.

Avatar

Avatar

pablom63973339

Avatar

pablom63973339

pablom63973339

29-07-2019

Thanks chirran414, this worked for me.

A small addition, it may be obvious for some but took me a while to realise. Is important that said template status is enabled and not in draft

Avatar

Avatar

chirran414

Avatar

chirran414

chirran414

26-02-2019

Step1: We need to create a separate template for Experience fragments under "conf" folder and adding superType as cq/experience-fragments/components/xfpage do necessary changes ... (in our case we overlay xfpage component did some changes as per our requirement). like how we-retail project did as shown in the bellow screenshot.

xfpage,+resourcetype.png

Step2:

  1. Browse to /content/experience-fragments
  2. Add your project Experience Fragment template path (/conf/example-project/settings/wcm/templates/experience-fragment(.*)?) to cq:allowedTemplates property under /content/experience-fragments as shown in the screenshot below:

1700399_pastedImage_8.png

These 2 changes would be enough

After that you can browse here and you can create experience fragment by selecting experience fragment template.

http://localhost:4502/aem/experience-fragments.html/content/experience-fragments

Avatar

Avatar

sushmaa61672298

Avatar

sushmaa61672298

sushmaa61672298

26-02-2019

Hi Chirran,

Can you please let me know what are the 2 additional changes you are referring to here.

One is adding superType as cq/experience-fragments/components/xfpage to the page component of my editable component.

What is the second change?

Avatar

Avatar

chirran414

Avatar

chirran414

chirran414

13-11-2018

yeah, I am also trying to say here is the same. we have to consider these things also for XF in addition to just adding cq:allowedTemplates property at /content/experience-fragments

Avatar

Avatar

Arun_Patidar

MVP

Total Posts

2.9K

Likes

1.0K

Correct Answer

831

Avatar

Arun_Patidar

MVP

Total Posts

2.9K

Likes

1.0K

Correct Answer

831
Arun_Patidar
MVP

12-11-2018

Actually page component for XF should have cq/experience-fragments/components/xfpage super type to enabled XF editor features similar like wcm page component.

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K
smacdonald2008

08-11-2018

But there really is no benefit to creating custom ones. I recommend choosing a default one.

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K
smacdonald2008

08-11-2018

It it is the cq:allowedTemplates property on /content/experience-fragments node that drives the availability of XF variations: