How to get absolutePath or absoluteParent in sightly ? | Community
Skip to main content
amoghd64765494
Level 3
Apr 24, 2017 7:52 PM UTC

How to get absolutePath or absoluteParent in sightly ?

Hi,

How to get absoluteParent or absolutePath in sightly without using use script and wcmuse class ?

I want to simply get the page path till homepage from any child page and want append my custom path. It should be something like .  ${currentPage.getAbsoluteParent.path} by passing int as a level of path i want to get.

Thanks,
Amogh

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

4 replies

Level 2
Dec 3, 2019 11:57 AM UTC

I know, I'm very late to the party but nevertheless responding hereby hoping it might be helpful to anyone landing on this post in future.

This is what you can use to get the parent path in sightly:

${currentPage.getParent.path}

Regards,

Prabhakar.

Translate
Daniel_H__A__Li
Level 2
Apr 26, 2017 9:12 AM UTC

Hi, Amogh.

I believe that is not possible to invoke Page.getAbsoluteParent(level) from a HTL expression...

Regards,

Daniel.

Translate
smacdonald2008
Level 10
Apr 25, 2017 2:13 PM UTC

I would personally use WCMUsePojo and bind to a data member. But if you want to use only front-end - here is the spec with all the syntax: 

https://github.com/Adobe-Marketing-Cloud/htl-spec/blob/master/SPECIFICATION.md

Translate
amoghd64765494
Level 3
Apr 25, 2017 3:15 PM UTC

smacdonald2008 wrote...

I would personally use WCMUsePojo and bind to a data member. But if you want to use only front-end - here is the spec with all the syntax: 

https://github.com/Adobe-Marketing-Cloud/htl-spec/blob/master/SPECIFICATION.md

 

 

Thanks Mac for the reply.

I have been through this site couple of times but could not get the exact syntax, which will work in this case.

I would be happy if you can provide the syntax :)

Thanks,
Amogh

Translate