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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Sightly convert string to node

sr508
Level 3
Level 3

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

2 Replies
ArpitVarshney
Community Advisor
Community Advisor

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.

Arun_Patidar
Community Advisor
Community Advisor

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.