Hi All,
I would like to get a component dialog value from editable template ..how to get it?
Component : /conf/AEMLearning64/settings/wcm/templates/testing-template/structure/jcr:content/root/navigation
Below code :
ContentPolicyManager contentPolicyManager = getResourceResolver().adaptTo(ContentPolicyManager.class);
if(contentPolicyManager !=null) {
ContentPolicy contentPolicy = contentPolicyManager.getPolicy(getCurrentpage().getContentResource()); // or resource
if(contentPolicy != null) {
navigationPath = contentPolicy.getProperties().get("navigationRoot").toString();
}
}
Here , contentpolicy getting value as null.
Regards,
Sathya
Views
Replies
Total Likes
If you have created a design dialog of a navigation component and want to retreive it in component HTL file.The corresponding data is stored inside policies of editable template and can be simply retrieved using ${currentStyle.propertyName}
Regards,
Arpit Varshney
Can you check the property name, your code looks ok though
e.g.
ContentPolicyManager policyManager = resourceResolver.adaptTo(ContentPolicyManager.
class
);
if
(policyManager !=
null
) {
ContentPolicy contentPolicy = policyManager.getPolicy(resource);
if
(contentPolicy !=
null
) {
title= (String) contentPolicy.getProperties().get(
"title"
);
}
}
Hi Arun,
Thanks for your reply !
Component values are stored under editable template :/conf/AEMLearning64/settings/wcm/templates/testing-template/structure/jcr:content/root/navigation
I am getting a null value in contentPolicy object if i try to pass resource or currentPage.getContentResource
Regards,
Sathya
Can you check if object getCurrentpage() is not null
Views
Likes
Replies