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

How to create node for directly included resources in component html via data-sly-resource?

Himanshu_Singhal
Community Advisor
Community Advisor

Hi,

I'm using AEM 6.0 SP2. I created a component and in component html, I've included 2 components directly using data-sly-resource. 

There's a constraint with AEM 6.0 SP2 that it doesn't create node for directly included resources when we drag parent component on page. So, when try to edit directly included component, it display json not found error and so component can't be edited. So, there's one way i.e create node for directly included component in template. But, it's a really hard-coded way.

What I'm trying to do is to create node for directly included resources in html.

<article data-sly-resource="${ @ path='samplenode', '/apps/<component-path>'}"></article>

If above mentioned code is directly included in component html, so when we drag component on page, it should dynamically create node 'samplenode' under parent component node so while edit, it doesn't throw any error.

Is there any possible way for this?

Regards,

Himanshu

5 Replies
antoniom5495929
Level 7
Level 7
        Could you put the error that you have after you try to use data-sly-resource?
antoniom5495929
Level 7
Level 7
        Please upload a package with your component in order to test it.
Himanshu_Singhal
Community Advisor
Community Advisor

Hi,

It was a product with AEM 6.0 SP2 but if you’ll upgrade to SP3, this problem automatically resolves.