get the parent page title if given child page path in multifield
Hi All,
I have created sling model for multifield which accept page path and from that page path need to access to page property That part i have done and it working fine.
issue is I wanted to access parent page title from the page path.
do you know how to do it?
please check the below code to access page property from the page path
String pagePath = pagePathResource.adaptTo(ValueMap.class).get("pagePath", String.class);
BlogPostModal blogPostModal = resourceResolver.getResource(pagePath + "/jcr:content")
.adaptTo(BlogPostModal.class);
blogPostModal.setResourcePath(pagePath != null ? pagePath : "");
blogPageList.add(blogPostModal);