Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

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

Avatar

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

Avatar

Level 7
        Could you put the error that you have after you try to use data-sly-resource?

Avatar

Level 7
        Please upload a package with your component in order to test it.

Avatar

Community Advisor

Hi,

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