I have a page where I want to access a node property from that page's jcr:content node
How can I do this? I remember seeing an example using the CQ tag or slightly
An example would be greatly appreciated.
Thanks!
Solved! Go to Solution.
Views
Replies
Total Likes
I figured it out, its done like this:
<%@include file="/libs/foundation/global.jsp"%>
<%
String title = properties.get("html", "default title");
%>
<%=title%>
Views
Replies
Total Likes
A page node under /content only holds markup - like HTL/HTML/JSP.
To access any node property - you have to use an API like the JCR API.
For example:
node.getProperty();
To learn how to use JCR API to access a node prop - see:
https://helpx.adobe.com/experience-manager/using/programmatically-accessing-cq-content-using.html
Hope this helps.
Views
Replies
Total Likes
Take a look at this doc topic:
https://docs.adobe.com/docs/en/cq/5-6-1/developing/pageinfo.html
It talks about an API you can use to get page information. I have never used that API myself - but it may help you get page info without using a lower level API like JCR API.
Views
Replies
Total Likes
not the page node, the property within the jcr:content of the page node is what I want to access
/content/MyPage/jcr:content <-- this
I want to access that node from the page...not using any java methods or anything.
I did it before but just can't find the documentation.
Views
Replies
Total Likes
I figured it out, its done like this:
<%@include file="/libs/foundation/global.jsp"%>
<%
String title = properties.get("html", "default title");
%>
<%=title%>
Views
Replies
Total Likes