Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Retrieve any custom property from page using HTL

test1234567
Level 2
Level 2

Hello community - is there a way to retrieve any page property other than the component node. i.e I have a component, in that I want to retrieve page's custom property which is not part of component node. I tried the below but it is not working. Can you advise me?

 

${page.getProperties['root/responsivegrid/content/customPropertyName']}

1 Accepted Solution
Bimmi_Soi
Correct answer by
Community Advisor
Community Advisor

Hi @test1234567 ,

 

Please use 

${pageProperties.propertyName @ context='html'}

 

And for any parent level property 

${inheritedPageProperties.propertyName}

 

And if you want to fetch component's property from page(components html) then make use of model of that component in page. There is no direct way to fetch those

 

If you need those properties in same component's html then simply use ${properties.propertyName}

 

Hope this helps!!!

 

Thanks

View solution in original post

3 Replies
Umesh_Thakur
Community Advisor
Community Advisor

Simply use ${pageProperties.name_of_the_property@ context='html'} or ${pageProperties.name_of_the_property}

for example to get title of the page use ${pageProperties.jcr:title @ context='html'} or ${pageProperties.jcr:title}

 

this is to get only currrent page properties if you need parent page properties you can use inheritedPageProperties to get the same.

 

Hope this will help.

Umesh Thakur

Bimmi_Soi
Correct answer by
Community Advisor
Community Advisor

Hi @test1234567 ,

 

Please use 

${pageProperties.propertyName @ context='html'}

 

And for any parent level property 

${inheritedPageProperties.propertyName}

 

And if you want to fetch component's property from page(components html) then make use of model of that component in page. There is no direct way to fetch those

 

If you need those properties in same component's html then simply use ${properties.propertyName}

 

Hope this helps!!!

 

Thanks

View solution in original post