0
votes

created a component under /apps/project folder comp1 with properties jcr:title, jcr: description etc.

All comp1 properties are stored at

/apps/project/components/common/comp1

I would like to access above component properties when this component drag and drop onto a page

Now the component is drag and drop onto a page. when I do currentNode.getPath - /content/project/en/page1/jcr:content/comp1

Not sure, how I could access the path /apps/project/components/common/comp1 and read properties such as jcr:title, jcr:description

Thank you!

2

2 Answers

0
votes

jcr:title, jcr:description properties are copied from /apps/project/components/common/comp1 to component when you dragged component to yours page.

So, you are able to acces this porperties using following code:

String title = currentNode.getProperty("jcr:title");
String description = currentNode.getProperty("jcr:description");
0
votes

If you use AEM6 in the JSP you can use properties.propertyname, also if you want to get a page property you can use pageProperties.propertyname