Dynamic value in data-sly-resource | Community
Skip to main content
Level 2
Jun 25, 2018 1:53 PM UTC
Solved

Dynamic value in data-sly-resource

Hi

I want to give a dynamic value in data-sly-resource, could someone please help how to achieve it.

I want to make the path of the resource as a dynamic value

<div data-sly-resource ="${'/content/new-page/jcr:content/parsys'}" data-sly-unwrap></div>

want to change it to something like

<div data-sly-resource ="${ currentPage.path + '/jcr:content/parsys'}" data-sly-unwrap></div>

Please help, Thanks in advance.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
arunpatidar
arunpatidarAccepted solution
New Participant
Jun 25, 2018 2:03 PM UTC

Hi,

What you want to do here? Can you please explain? so that we can help

but for your query you can use

<div data-sly-resource ="${currentPage.path}/jcr:content/parsys" data-sly-unwrap></div>

Thanks
Arun

Arun Patidar

2 replies

Level 2
Jun 25, 2018 3:51 PM UTC

I just wanted to display all the content of some parsys on some other place on the page again with out being to author the same content again.

And thank for the reply, it helps.

Translate
arunpatidar
arunpatidarAccepted solution
New Participant
Jun 25, 2018 2:03 PM UTC

Hi,

What you want to do here? Can you please explain? so that we can help

but for your query you can use

<div data-sly-resource ="${currentPage.path}/jcr:content/parsys" data-sly-unwrap></div>

Thanks
Arun

Translate
Arun Patidar