Configure cq:xfVariantType in experience fragment.

Avatar

Avatar

Gajanan_Kulkarn

Avatar

Gajanan_Kulkarn

Gajanan_Kulkarn

20-06-2018

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

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

20-06-2018

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

Answers (4)

Answers (4)

Avatar

Avatar

rupalig70586203

Avatar

rupalig70586203

rupalig70586203

21-09-2018

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

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

18-09-2019

Avatar

Avatar

mihirm64625024

Avatar

mihirm64625024

mihirm64625024

17-09-2019

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.

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

20-06-2018

Refer to the docs here - Experience Fragments

There is no mention of this in the docs.