Unable to get current Page Path in cloud publisher environment.
Hi Guys
I have one requirement where i need to get a current page path to pass it into some logic in component level and that component is used in experience fragment and that fragment is used in template, template used for creating pages.
Method 1-
<header data-sly-use.header="${'com.xyz.aem.core.models.Header' @ currentPagePath = currentPage.path}"
@RequestAttribute(name="currentPagePath")
private String currentPagePath;
Method 2-
@586265
private Page currentPage;
private String currentPagePath = currentPage.getPath();I have used these two methods in sling model, its working as expected in local instance(author/publisher) and cloud author instance but in cloud publisher environment its giving the template path. if i use the component alone in a page its working fine but the requirement is to keep that component in experience fragment and SDI used to include that experience fragment in template level
Steps i followed to troubleshoot.
1-cleared the SDI level cache
2-cleared the page level cache
3-used loggers to check how its behaving
im not able to identify why its behaving,