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

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list
SOLVED

synthetic resource creation

Avatar

Level 6

Hi,

 

I am looking to create dummy resource with a resourceType (text), valuemap properties and not to create any real jcr data/nodes.

 

In sightly html get the dummy resource using "data-sly-resource" tag and render it.

 

Thanks for all the help.

 

Usecase: retrieve content fragments elements and have it as accordion item panel title, child text component.

 

Thanks,

Sri

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @sreenu539 ,

 

Yes we can use it via Sling. Sling model can be used to define such resource and its appropriate properties and it can be used by HTL for rendering.

 

https://developer.adobe.com/experience-manager/reference-materials/6-5/javadoc/org/apache/sling/api/... 

View solution in original post

4 Replies

Avatar

Community Advisor

Hi @sreenu539 ,

 

In order to use "data-sly-resource", it requires a physical location of the node.

But you can achieve this in a different way using AemContext api.

 

for the mentioned use case, why can't you simple get the resource of your content fragment an iterate through the configured properties?

 

Avatar

Correct answer by
Community Advisor

Hi @sreenu539 ,

 

Yes we can use it via Sling. Sling model can be used to define such resource and its appropriate properties and it can be used by HTL for rendering.

 

https://developer.adobe.com/experience-manager/reference-materials/6-5/javadoc/org/apache/sling/api/... 

Avatar

Community Advisor

no, its synthetic. it wont create any node under content.