synthetic resource creation | Adobe Higher Education
Skip to main content
sreenu539
Level 7
October 6, 2022
Besvarat

synthetic resource creation

  • October 6, 2022
  • 2 svar
  • 1794 visningar

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

Det här ämnet har stängts för svar.
Bästa svar av Kishore_Kumar_

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/resource/SyntheticResource.html 

2 svar

B_Sravan
Community Advisor
Community Advisor
October 8, 2022

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?

 

Kishore_Kumar_
Level 9
October 9, 2022

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/resource/SyntheticResource.html 

sreenu539
sreenu539Skribent
Level 7
October 10, 2022

Does this create an actual resource ?

Kishore_Kumar_
Level 9
October 16, 2022

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