Expand my Community achievements bar.

Adobe Summit 2025: AEM Session Recordings Are Live! Missed a session or want to revisit your favorites? Watch the latest recordings now.

Mark Solution

This conversation has been locked due to inactivity. Please create a new post.

SOLVED

synthetic resource creation

Avatar

Level 7

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
Level 10

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
Level 10

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

Level 7

Does this create an actual resource ?

Avatar

Level 10

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