I tried to find an Adobe post related to TemplatedContainer.
Could you please help me what is TemplatedContainer, as we have to use this in Editable Template.
I have seen many code snippet like below:
<sly data-sly-use.templatedContainer="com.day.cq.wcm.foundation.TemplatedContainer"
data-sly-repeat.child="${templatedContainer.structureResources}"
data-sly-resource="${child.path @ resourceType=child.resourceType, decorationTagName='div'}"/>
But don't know what is this and what and where is the use of TemplatedContainer
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
@tushaar_srivastava This is what I understand about this API. Since there is not much documentation on how the API works and what each method actually does, I did some research. So basically the api helps to resolve your templates , structure node. Lets take an example of the WKND pages ( the sample project )
So lets say I have a page best-tacos-in-the-city.html This page is defined using article-page-template . Now for the article page template , you have a structure node , where the structure of your template is defined and the node structure for the same would be as below
TemplatedContainer API helps you to fetch these structure nodes or to check if the template has a structured content and its inherited methods from WCMPojo helps with a lot of other page and resource methods. Please check https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/javadoc/co...
Coming back to the structuredResource ,
<sly data-sly-use.templatedContainer="com.day.cq.wcm.foundation.TemplatedContainer"
data-sly-list.child="${templatedContainer.structureResources}">
If you try to print and check ${child.path} , you can see that it resolves to the structure content node, in this case /conf/wknd/settings/wcm/templates/article-page-template/structure/jcr:content/root
In line 18 of the above body.html , when the child.path is included as a resource , you are actually including the "/conf/wknd/settings/wcm/templates/article-page-template/structure/jcr:content/root" node as a resource and that way all the below resources of the root node will get included to your page.
Hope this helps. Let me know if you have any more questions.
Thanks
Veena
com.day.cq.wcm.foundation.TemplatedContainer extends WCMUsePojo
This looks like a snippet from the body.html within the WCM Core Page V2 Component. It's an AEM component with a one to one releationship with a WCMUsePojo Class. The WCmUsePojo Class returns a "structureResources" property to the Sightly HTL script for its consumption. The "structureResources" is a List<Resource> Object, and the data-sly-repeat, expression to repeat the content of the element for each item of the provided object is utilised.
For each repeat, data-sly-resource, is called which Includes a rendered resource to the page with a decorationTagName "div".
You can imagine the body.html takes all the resources listed in the /content/my-site/page/jcr:content/*, and attempts to server-side render all the resources to the resulting page.
I hope this helps.
@tushaar_srivastava This is what I understand about this API. Since there is not much documentation on how the API works and what each method actually does, I did some research. So basically the api helps to resolve your templates , structure node. Lets take an example of the WKND pages ( the sample project )
So lets say I have a page best-tacos-in-the-city.html This page is defined using article-page-template . Now for the article page template , you have a structure node , where the structure of your template is defined and the node structure for the same would be as below
TemplatedContainer API helps you to fetch these structure nodes or to check if the template has a structured content and its inherited methods from WCMPojo helps with a lot of other page and resource methods. Please check https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/javadoc/co...
Coming back to the structuredResource ,
<sly data-sly-use.templatedContainer="com.day.cq.wcm.foundation.TemplatedContainer"
data-sly-list.child="${templatedContainer.structureResources}">
If you try to print and check ${child.path} , you can see that it resolves to the structure content node, in this case /conf/wknd/settings/wcm/templates/article-page-template/structure/jcr:content/root
In line 18 of the above body.html , when the child.path is included as a resource , you are actually including the "/conf/wknd/settings/wcm/templates/article-page-template/structure/jcr:content/root" node as a resource and that way all the below resources of the root node will get included to your page.
Hope this helps. Let me know if you have any more questions.
Thanks
Veena
Views
Replies
Total Likes
Views
Replies
Total Likes
.
Views
Replies
Total Likes
Hi Veena,
This article is really awesome and it explains everything about templateContainer in details. I have one query in case if the cq:template path on the jcr:content node of the page is missing or having path which is not present or removed in that case what would happen .
Will the page render or it will hang and page will keep on loading. Do you see such use case?
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies