[Thread Edited By Adobe]
/*Don’t forget to meet and greet your fellow peers virtually by telling them about yourself here.
Go ahead and to it now: https://adobe.ly/3eDnB4v */
Actual Question:
In JSP I have used (currentPage.getContentResource()).getResourceType() to access resourcetype of a template from a component.
In sightly I wondered if we can access the same using ${pageProperties}
I am trying following from the component.html , and I get empty String Values
${pageProperties.cq:designPath} <br/>
${pageProperties.jcr:title} <br/>
${pageProperties.sling:resourceType} <br/>
How can I do this in Sightly ?
Solved! Go to Solution.
If you have this in JSP, you can do it like this in Sightly:
${currentPage.getContentResource.getResourceType}
or
${currentPage.contentResource.resourceType}
Try below:
${currentPage.title}
${currentPage.path}
Cheers,
Sudheera
Hi,
Not quite sure if this helps, but just pasting it across[it looks like probably there are other two methods available].
There are three methods to access content in AEM WCM:
Hi,
Try this -
${pageProperties['cq:designPath']} <br/>
${pageProperties['jcr:title']} <br/>
${pageProperties['sling:resourceType']} <br/>
Thanks,
AryA.
Dinu_Arya wrote...
Hi,
Try this -
${pageProperties['cq:designPath']} <br/>
${pageProperties['jcr:title']} <br/>
${pageProperties['sling:resourceType']} <br/>
Thanks,
AryA.
This did not work for me , when I use this on my component.html :(.
I still see the empty strings
sudheeras wrote...
Try below:
${currentPage.title}
${currentPage.path}
Cheers,
Sudheera
I tried this as well. I am still not able to access these page Properties
If you have this in JSP, you can do it like this in Sightly:
${currentPage.getContentResource.getResourceType}
or
${currentPage.contentResource.resourceType}
Feike Visser wrote...
If you have this in JSP, you can do it like this in Sightly:
${currentPage.getContentResource.getResourceType}
or
${currentPage.contentResource.resourceType}
I checked with my colleague its working for him.
Do I need to install any new hot fix / service pack ? for Sightly to work fine ?
This is basic/core functionality of Sightly, no need for add-ons here.
How can I access node properties of different nodes. (directly by HTL , not by js or java )
something like this ?
<div id="data" data-sly-use.tesr="/etc/ttt">
${tesr.count}
How can I access node properties of different nodes? ( not current page, directly by HTL , not by js or java )
In 6.3 you can access the resource directly via data-sly-use.
Example: htl-examples/button.html at master · heervisscher/htl-examples · GitHub
Any way we can do it in 6.1 . Was trying by HTL Block Statements
<div data-sly-use.product=“/etc/commerce/product/12345”>
${ product.title }
</div>
this feature was added in 6.3
What about getting other properties other than the title when using a jsp, such as getting the height?
Actually we can read the page properties in CQ as below.
${pageProperties.jcr:description}
If we enter jcr:description as some html content is page properties. How to read/handle that in sightly? Any suggestions please?
${pageProperties.jcr:description @ context='html'}
Thank u felike visser..it is working
awesome
Hi, Could you please exrplain when to use pageProperties,properties and currentPage .
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies