Accessing properties from Sub objects in page properties from HTL or Use classes | Community
Skip to main content
Level 3
September 28, 2017
Solved

Accessing properties from Sub objects in page properties from HTL or Use classes

  • September 28, 2017
  • 3 replies
  • 1201 views

Hi,

I have the following structure within a page where we store details of a person.  There will be one person per page and we have tried to give the person data some sort of structure to break things up (eg jcr:content\person and jcr:content\person\social)

It might be late in the day but I am blank as to how to access these properties and objects from within either HTL or a supporting use class.

Could anyone shed any light on this?

Thanks

Screen shot of structure included.

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

Hi,

I think we will likely use that approach going forward.  However we noticed that we can use the pageProperties from within the HTL. Seems to work as we expect. So we will go with this in the meantime. 

Thanks

<a href="${pageProperties['person/social/linkedin']}" title="Connect to ${pageProperties['person/name']} on LinkedIn" target="_blank">Connect</a>

3 replies

kautuk_sahni
Community Manager
Community Manager
October 9, 2017

Feike Visser  Any help here?

Kautuk Sahni
edubey
Level 10
October 9, 2017

Component way...

1. Create a component which render person node.

2. Write up a sling model which can read properties ( technically it will adapt to resource)

3. Use the values returned by sling model in HTL

AEM Developer Learning : Sling Model Exporter in AEM 6.3

Thanks

iainc65537558AuthorAccepted solution
Level 3
October 9, 2017

Hi,

I think we will likely use that approach going forward.  However we noticed that we can use the pageProperties from within the HTL. Seems to work as we expect. So we will go with this in the meantime. 

Thanks

<a href="${pageProperties['person/social/linkedin']}" title="Connect to ${pageProperties['person/name']} on LinkedIn" target="_blank">Connect</a>