1. Created a node inside the component of type nt:unstructured called cq:template. Added a property called fragmentPath of type String to it with default value for XF path.
2. Created a sling:folder outside the component called templateConfigs, created node of type nt:unstructured inside it called experienceFragment . Added a property to it called fragmentPath of type String. Then added a property to component called cq:templateType (String) and added path of the new config as its value.
@Arun_Patidar beat me to the punch 😉 But his answer is correct! One thing to know is that the value is cq:template are set when a component is created. That means if you placed your component on the page, then modified the cq:template values, you would have to remove and add the component again to see the changes, maybe that is your problem? 🙂
Other things to look out for:
The cq:template child must have the same name as the name of the resource in your data-sly-resource attribute (ie: experiencefragment)
The property you want to set a default for must match the name of that property in the target resourceType (ie: fragmentPath)
Create a node inside the component of type nt:unstructured called cq:template. Add a child node experiencefragment type of nt:unstructured and add a property called fragmentPath of type String to it with the default value for XF path.