Hi All,
We have created "basepage" whose sling:resourceSuperType="foundation/components/page". All the other templates/pages are extending from this. In "basepage" template, we have added certain custom properties[always populated with default values] in "Advanced" tab. Now, when I create a sample page of any template, I want to retrieve custom property say 'x'.
Tried the below :
1] In my WCMUSe class, activate method tried String custom=getInheritedProperties().get("x").toString();
But it is not working.
2] Tried final ValueMap properties = getResource().getValueMap();
custom = properties.get("x",String.class);
but not working.
Any thoughts/pointers/reference on this will be really helpful.
Views
Replies
Total Likes
Hi All,
I even tried the below , but not working.
protected InheritanceValueMap Prop;
res=getResource();
Prop = new HierarchyNodeInheritanceValueMap(res);
String value = Prop.getInherited("website",String.class);
Any thoughts/references will be really helpful
Views
Replies
Total Likes
Anything which is in the page properties dialog should be present in the jcr:content node.
Try something like this
Resource pageResource = resourceResolver.getResource("pagePath"+ "/jcr:content");
String customProperty = pageResource.getValueMap().get("customProperty", "").toString();
Thanks
Tuhin
Views
Replies
Total Likes