Solved! Go to Solution.
Views
Replies
Total Likes
Hi @sean12341 ,
There are multiple ways to achieve it.
SELECT * FROM [nt:base] AS s WHERE ISDESCENDANTNODE([/conf/we-retail]) AND NAME() = 'policy_1526037253202'
This will give you the path "/conf/we- retail/settings/wcm/policies/weretail/components/content/teaser/policy_1526037253202" in the result.
2. Quite a manual approach, because if you look at the path there is a pattern
/conf/we-retail/settings/wcm/templates/section-page/policies/jcr:content/root/responsivegrid/weretail/components/content/teaser/policy_1526037253202
/conf/we-retail/settings/wcm/policies/weretail/components/content/teaser/policy_1526037253202
All you need to do is pick the partial path and append "/conf/we-retail/settings/wcm/policies" and you will always end up into the same directory.
Hope that helps!
Regards,
Nitesh
Hi @sean12341 ,
There are multiple ways to achieve it.
SELECT * FROM [nt:base] AS s WHERE ISDESCENDANTNODE([/conf/we-retail]) AND NAME() = 'policy_1526037253202'
This will give you the path "/conf/we- retail/settings/wcm/policies/weretail/components/content/teaser/policy_1526037253202" in the result.
2. Quite a manual approach, because if you look at the path there is a pattern
/conf/we-retail/settings/wcm/templates/section-page/policies/jcr:content/root/responsivegrid/weretail/components/content/teaser/policy_1526037253202
/conf/we-retail/settings/wcm/policies/weretail/components/content/teaser/policy_1526037253202
All you need to do is pick the partial path and append "/conf/we-retail/settings/wcm/policies" and you will always end up into the same directory.
Hope that helps!
Regards,
Nitesh
where you wanted to get the actual path, in code?
If in code you just need to get property value for policy and get the resource object with the help of resource resolver for the path.
Yes I want to get the path programmatically.
Could you provide an example or pseudo code of how it can be done?
I have tried the following:
resourceResolver.getResource("/conf/we-retail/settings/wcm/templates/section-page/policies/jcr:content/root/responsivegrid/weretail/components/content/teaser").getValueMap().get("cq:policy")
But still only returns the relative path of the policy, which is:
"weretail/components/content/teaser/policy_1526037253202"
Thanks
Why would you need that? Currently that is an implementation detail of AEM, and trying to rely on the implementation (although not specified) might work, but it could also break in interesting and unexpceted ways.
Views
Likes
Replies