Get page path with experience fragment and sling dynamic include | Community
Skip to main content
nagendra_prasa1
Level 2
April 3, 2018
Question

Get page path with experience fragment and sling dynamic include

  • April 3, 2018
  • 0 replies
  • 1781 views

We have an experience fragement in page header section. And this experience fragment contains components( Ex: loginheader component) which

render information based on logged in user. So to be able to cache this page, we have configured

Sling Dynamic Include for the components in the header section.

Page URL:

/content/sitea/home.html

URL of Experience Fragement included in the head section of the page:

/content/experience-fragments/sitea/headernav/headernav

Generated SDI URL for loginheader component:

<!--#include virtual="/content/experience-fragments/sitea/headernav/headernav/_jcr_content/root/responsivegrid/loginheader.nocache.html" --></div>

Since the generated SDI url starts with the content fragment path instead of the actual page being requested,

I do not see a way to get the actual page URL in loginheader component code.

Please let me know if it is possible to get the page path in the component?

Thanks,

Nagendra

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.