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.
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.
BUT Make sure when you create variant choose correct template for variant. I chose same template for both master and variation.
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.