Expand my Community achievements bar.

SOLVED

How to add cq:xfVariantType to a Template for Experience Fragments?

Avatar

Level 4

Issue: On AEM 6.4.. When trying to refer an Experience Fragment inside an "Experience Fragment Component" on a sites/page, the "experience fragments without any "cq:xfVariantType" property do not show up. The Experience fragment functions normal.

Screen Shot 2019-09-12 at 5.30.02 PM.png

Screen Shot 2019-09-12 at 5.30.14 PM.png

As of now we have added this via code but there is not way to add this property to the "editable template" other than via crx/de. And which is not a way we can recommend to customers while building editable templates.

Screen Shot 2019-09-12 at 5.27.50 PM.png

Screen Shot 2019-09-12 at 5.33.29 PM.png

Referred this: Configure cq:xfVariantType in experience fragment. and copied the property referring to We.Retail's "Experience Fragment Web Variation" template.

Is this an error with General > Experience Fragment component?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

I believe you are creating experience fragment templates using experience fragment template type.

As a developer, you still need to create template type and there you can add cq:xfVariantType property in initial content.

whenever you will create new xf template using xf template type, cq:xfVariantType property will be added to new templates.

e.g.

/conf/we-retail/settings/wcm/template-types/empty-xf-page/initial/jcr:content



Arun Patidar

View solution in original post

8 Replies

Avatar

Employee

The cq:xfVariantType {String} web property must be set on the initial template for it to show up.

/conf/<your_organization>/settings/wcm/templates/experience-fragment-web-variation/initial/jcr:content

The templates must be allowed via the cq:allowedTemplates property set at the root jcr:content node of the site.

/content/<your_site>/jcr:content

/conf/<your_organization>/settings/wcm/templates/.*

Avatar

Level 3

hi ,

 

I am facing a similar issue. However the issue is that there is a huge number of already existing experience-fragment in our content.experience-frgament folder for which the property has not been added. 

Adding the property cq:xfVariantType to the template , only resolves the issue for all XFs which would be created in the future, however how to make sure the XF variation  is visible to the authors for the existing XF pages.

 

Will this be only possible by bulk-editing all of them and adding the property manually? or it is possible to add this to the overlayed XF component?

 

Thanking you in anticipation,

Samiksha.

Avatar

Level 4

Yes, i agree and adding them did solve the problem. But this has to be done via Code or crx/de and not via AEM UI.

When users/template-authors are building an Editable template on the AEM UI.. they cannot use them unless a "developer" is involved.

So i see the process as..

  • Build an editable template in AEM
  • Make a package out of it
  • Import that package into codebase, add the "cq:xfVariantType" property and deploy it back to AEM again.

Something is not correct here?

Avatar

Level 4

Thanks Vish.dhaliwal we were able to identify that XF needs that property from this post. Only We.Retail example had this and is not documented anywhere on the documentation pages. Or if it is, i'm missing it.

Avatar

Correct answer by
Community Advisor

I believe you are creating experience fragment templates using experience fragment template type.

As a developer, you still need to create template type and there you can add cq:xfVariantType property in initial content.

whenever you will create new xf template using xf template type, cq:xfVariantType property will be added to new templates.

e.g.

/conf/we-retail/settings/wcm/template-types/empty-xf-page/initial/jcr:content



Arun Patidar

Avatar

Community Advisor

Thanks surenk for sharing this.



Arun Patidar