Expand my Community achievements bar.

SOLVED

Configure cq:xfVariantType in experience fragment.

Avatar

Level 1

Hi All,

We are creating experience fragments in our project and when we are trying to add components in the variants created, we are not getting any components though we have allowed all the components in the template. The only difference between the we-retail template and our template is that in our template, we don't have cq:xfVariantType.

Can you please help me to understand where exactly i need top set this property while creating experience fragment template or template type or experience fragment variant ?

Also it will be helpful if you let me know what is the significance of this property.

Thanks and Regards,

Gajanan

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,

I am able to add component in variant without cq:xfVariantType.

This property doesn't make any difference , it looks it is a custom property and getting used for custom purpose.

This property is added in template initial (e.g. /conf/we-retail/settings/wcm/templates/experience-fragment-web-variation/initial/jcr:content) after creating template.

What I did, I copied /conf/we-retail/settings/wcm/templates/experience-fragment-web-variation template and created new /conf/we-retail/settings/wcm/templates/experience-fragment-variation and removed cq:xfVariantType from new template's initial  /conf/we-retail/settings/wcm/templates/experience-fragment-variation/initial/jcr:content

Then I created XF using this new template and added content in master and variant

Below is the screenshot of XF without cq:xfVariantType and Insert component dialog for variation.

Screen Shot 2018-06-21 at 12.30.34 AM.pngScreen Shot 2018-06-21 at 12.31.34 AM.png

BUT Make sure when you create variant choose correct template for variant. I chose same template for both master and variation.

Thanks

Arun



Arun Patidar

View solution in original post

6 Replies

Avatar

Level 10

Refer to the docs here - Experience Fragments

There is no mention of this in the docs.

Avatar

Correct answer by
Community Advisor

Hi,

I am able to add component in variant without cq:xfVariantType.

This property doesn't make any difference , it looks it is a custom property and getting used for custom purpose.

This property is added in template initial (e.g. /conf/we-retail/settings/wcm/templates/experience-fragment-web-variation/initial/jcr:content) after creating template.

What I did, I copied /conf/we-retail/settings/wcm/templates/experience-fragment-web-variation template and created new /conf/we-retail/settings/wcm/templates/experience-fragment-variation and removed cq:xfVariantType from new template's initial  /conf/we-retail/settings/wcm/templates/experience-fragment-variation/initial/jcr:content

Then I created XF using this new template and added content in master and variant

Below is the screenshot of XF without cq:xfVariantType and Insert component dialog for variation.

Screen Shot 2018-06-21 at 12.30.34 AM.pngScreen Shot 2018-06-21 at 12.31.34 AM.png

BUT Make sure when you create variant choose correct template for variant. I chose same template for both master and variation.

Thanks

Arun



Arun Patidar

Avatar

Level 2

Hi,

We need property cq:xfVariantType with value web on intial page jcr:content node of the template to allow an author to select the variation of your XF on the page.

If you dont add this property then you will not be able to select your Xf master variation path on the content page and you need to add it manually for ex. /master.

Avatar

Level 1
I have already added cq:xfVariantType but I didn't find my varients.so I used /master option.

Avatar

Level 1

Yes, this property seems to be required for the experience fragments to work properly. Without this property the experience fragment selection doesn't show the variant you have to type in the variation manually. Also, as I was using the newest experience fragment component (from WCM core), I ran into an issue wherein if this property is not present the experience fragment component doesn't even show the experience fragment (when configured on template).

So, I think the issue here is that this property seems to be needed but, it's not clear where this property should be configured. I think setting this on initial content behind the scene by going to CRXDE is not the ideal way. Template editors need to be able to set this property when creating the template from an experience fragment template type. For now, I am getting around by adding this property to the template behind the scenes.