How do you add an Experience Fragment template? | Community
Skip to main content
Level 2
Sep 13, 2022 10:22 PM UTC
Solved

How do you add an Experience Fragment template?

Our team is currently looking into building a proof of concept experience fragment that we can test in different subsites to see how it will render. I've been looking for information on how to add an existing page template as an experience fragment or how to create a new one, but what I've tried so far hasn't added the template.

Is there any documentation or otherwise about how to do this?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Saravanan_Dharmaraj
Saravanan_DharmarajAccepted solution
New Participant
Sep 13, 2022 11:25 PM UTC

4 replies

Ankur_Khare
New Participant
Sep 14, 2022 4:17 AM UTC

Hi,

If you have created your project using archtype there must be a template already created you can refer the same to create a new one.

So to create a new xf template it's similar to templates just that page template would be used to create new xf template.

Refer wknd code as well.

Regards 

Ankur

 

 

Translate
B_Sravan
New Participant
Sep 14, 2022 4:11 AM UTC
  • if you are using an archetype generated project, you can create a experience fragment template at http://localhost:4502/libs/wcm/core/content/sites/templates.html/conf just as you create a usual editable page template. While choosing the template type, select the experience fragment type.
  • Other wise, create a folder(lets name is sampleProject) under configuration browser with editable templates checkbox checked.
    go back to http://localhost:4502/libs/wcm/core/content/sites/templates.html/conf and create a template under "sampleProject" and leave it raw. Now go to crx de, copy the newly created to "/conf/sampleProject/settings/wcm/template-types/<newly-created-template>" and name this as experience fragment template. Now You can create XF template similar to page template and add new template in cq:allowedTemplates property at /content/experience-fragments.

 

I hope this helps, 

Thank you.

Translate
Saravanan_Dharmaraj
Saravanan_DharmarajAccepted solution
New Participant
Sep 13, 2022 11:25 PM UTC
Level 2
Sep 14, 2022 4:48 PM UTC

Thanks! I did see that post, but I was able to piece together what needs to be done:

 

  1. Create a copy of a page template in /conf/<project-name>/settings/wcm/templates/
  2. Renamed to experience-fragment-web-variation
  3. Go to /content/experience-fragments/
  4. Add /conf/<project-name>/settings/wcm/templates/experience-fragment(.*)? to cq:AllowedTemplates

I think the difference that made this a little confusing is that our team is utilizing a custom page template type for the page templates.


Also, while these posts are helpful, I feel like I'm only getting half of the information regarding how to work with experience fragment templates. It would be nice if Adobe provided a bit more documentation here for this.

Translate