Sightly convert string to node | Community
Skip to main content
Level 3
September 30, 2019

Sightly convert string to node

  • September 30, 2019
  • 2 replies
  • 3148 views

Hi,

is there a possiblitiy to convert the string to node in sightly.

if i have ${item.name} which is the name of the node . But ${item.name} is retiring as string. i need to access the properties of the node.

Any suggestions will be helffull

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

2 replies

ArpitVarshney
Community Advisor
Community Advisor
September 30, 2019

Hi,

You can get the property of the node in HTL using their path as shown below:

<sly data-sly-use.page="/content/dev-aem/en/jcr:content">${page.jcr:title}</sly>

Also, I would recommend writing these logics in JS use API or Java classes.

arunpatidar
Community Advisor
Community Advisor
September 30, 2019

try ${item.propertyName}

If you want to get child node from the item node based on the name of the node, then you need to write JS use API or Java Model.

Arun Patidar