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

Sightly convert string to node

Avatar

Avatar
Validate 1
Level 3
sr508
Level 3

Likes

2 likes

Total Posts

51 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 10
Ignite 1
View profile

Avatar
Validate 1
Level 3
sr508
Level 3

Likes

2 likes

Total Posts

51 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 10
Ignite 1
View profile
sr508
Level 3

30-09-2019

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

Replies

Avatar

Avatar
Validate 1
MVP
ArpitVarshney
MVP

Likes

136 likes

Total Posts

185 posts

Correct Reply

36 solutions
Top badges earned
Validate 1
Establish
Give Back 5
Give Back 3
Give Back 25
View profile

Avatar
Validate 1
MVP
ArpitVarshney
MVP

Likes

136 likes

Total Posts

185 posts

Correct Reply

36 solutions
Top badges earned
Validate 1
Establish
Give Back 5
Give Back 3
Give Back 25
View profile
ArpitVarshney
MVP

30-09-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.

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,358 likes

Total Posts

3,228 posts

Correct Reply

918 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,358 likes

Total Posts

3,228 posts

Correct Reply

918 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

30-09-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.