<div data-sly-resource="${'inlinesubscribe' @ resourceType='abc/components/content/inlinesubscribe'}"></div>
<div data-sly-resource="${'inlinesocial' @ resourceType='abc/components/content/inlinesocial'}"></div>
im adding this code to configure inlinesubscribe and inlinesocial component inside another component.. these two components is having cq:template default values.
but those are not rendering if i add it inside another component.
individually its working fine.
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @SudarshanV1
It will not work if component is embedded within another component.
In this case you need to add cq:template to parent component with content structure e.g.
Hi @SudarshanV1
Use data-sly-include
Instead
Replace data-sly-resource
with data-sly-include
to include rendered content with default properties:
<div data-sly-include="${'/content/path/to/inlinesubscribe' @ resourceType='abc/components/content/inlinesubscribe'}"></div>
<div data-sly-include="${'/content/path/to/inlinesocial' @ resourceType='abc/components/content/inlinesocial'}"></div>
Pass Default Properties Manually
If defaults aren’t applied, explicitly pass them in data-sly-resource
:
<div data-sly-resource="${'inlinesubscribe' @ resourceType='abc/components/content/inlinesubscribe', prop1='default1'}"></div>
<div data-sly-resource="${'inlinesocial' @ resourceType='abc/components/content/inlinesocial', prop1='default1'}"></div>
Check Policies & Resource Inheritance
Ensure proper template policies and sling:resourceSuperType
for both components.
Debug Properties
Use ${properties @ context='json'}
in the child components to verify passed values.
Please let me know if you need further help
Thanks
Partyush
Is the parent component a container component? Refer this for including a component inside another component - https://medium.com/@arunpatidar26/cq-iscontainer-property-in-aem-94e5318e04fa
Hi @SudarshanV1
It will not work if component is embedded within another component.
In this case you need to add cq:template to parent component with content structure e.g.
Views
Likes
Replies