Hi,
I have an experience fragment on a page and I need to strip the containing <div class="cmp-container"... and <div class="header"...
I saw a post on here about adding a resourceType to strip the added containers and this worked perfectly for static components but I'm having issues figuring out what to add for the XF.
This is how the xf is included:
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @doodls ,
Hard Coded Example
The first example uses sightly to reference an experience fragment, /content/experience-fragments/we-retail/equipment, and the required variation, master. This will only work when the path includes the experience fragment variation path. The value here is hard coded.
<sly data-sly-resource="${@path='/content/experience-fragments/we-retail/equipment/master', selectors='content', wcmmode='disabled'}"></sly>
Dynamic Example
In the second example, we can see that our component adapts to the com.mysite.models.component.MyCustomComponent, Sling Model backend, and then it exposes the experience fragment in the exPath property. The value returned from the exPath is ‘/content/experience-fragments/we-retail/equipment/master’.
<sly data-sly-use.cmp="com.mysite.models.component.MyCustomComponent"></sly> <sly data-sly-resource="${@path=cmp.exPath, selectors='content', wcmmode='disabled'}"></sly>
Hope that helps you!
Regards,
Santosh
Hi @doodls ,
Hard Coded Example
The first example uses sightly to reference an experience fragment, /content/experience-fragments/we-retail/equipment, and the required variation, master. This will only work when the path includes the experience fragment variation path. The value here is hard coded.
<sly data-sly-resource="${@path='/content/experience-fragments/we-retail/equipment/master', selectors='content', wcmmode='disabled'}"></sly>
Dynamic Example
In the second example, we can see that our component adapts to the com.mysite.models.component.MyCustomComponent, Sling Model backend, and then it exposes the experience fragment in the exPath property. The value returned from the exPath is ‘/content/experience-fragments/we-retail/equipment/master’.
<sly data-sly-use.cmp="com.mysite.models.component.MyCustomComponent"></sly> <sly data-sly-resource="${@path=cmp.exPath, selectors='content', wcmmode='disabled'}"></sly>
Hope that helps you!
Regards,
Santosh