Expand my Community achievements bar.

Get page path with experience fragment and sling dynamic include

Avatar

Level 2

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

0 Replies