Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.
SOLVED

Component and Parsys related doubt.

Avatar

Level 9

Hi All,

Doubts as below :

1] In any component, if I have to include another component then it has to have a parsys in it and nothing else is required, correct?

2] Also, I have seen that in many components the below is to be seen while including parsys, where "xxx" is different in different cases. Did go through couple of documentation but was not clear. What exactly does '@path' do here.

 <div data-sly-resource="${ @path='xxx-parsys', resourceType='foundation/components/parsys'}"></div>

Any thoughts on this will be helpful.

1 Accepted Solution

Avatar

Correct answer by
Level 10

1. In your component contains parsys then you can include any component inside it via drag n drop 

[OR]

You can include a component in another component via code also like this

 <div data-sly-resource="${ @path='par-text', resourceType='foundation/components/text'}"></div>

2. Once you get parsys on page, If you drag an drop any component inside it, then that will be saved under the node name which has been given in path='xxx-parsys', 

View solution in original post

8 Replies

Avatar

Correct answer by
Level 10

1. In your component contains parsys then you can include any component inside it via drag n drop 

[OR]

You can include a component in another component via code also like this

 <div data-sly-resource="${ @path='par-text', resourceType='foundation/components/text'}"></div>

2. Once you get parsys on page, If you drag an drop any component inside it, then that will be saved under the node name which has been given in path='xxx-parsys', 

Avatar

Level 9

Hi Praveen,

Thanks a lot for your reply.

One more  doubt I have is, 

1] I have included a parsys in the component and am able to include components. However, in the component html it is mentioned that certain components have to appear at certain locations.

For example :

<div> richtext component <div>

<div> richtext component <div>

<div> richtext component <div>

So, in the corresponding divs have included the component by <div data-sly-resource="${ @path='xxx', resourceType='aem/components/content/richtext'}" data-sly-unwrap></div>.

However, they are not editable when I click on them.

Can you please let me know as to what is it that I am missing here.

Avatar

Level 9

One more thing to add is that the dialog for the main component, where I am including other components has a dialog[wherein we have radiobuttons to select from around 6 colours]

Avatar

Level 10

There might be something wrong in component you are trying to include.

I tried with OOTB text component, it works

 

Can you explain this, I didn't get

One more thing to add is that the dialog for the main component, where I am including other components has a dialog[wherein we have radiobuttons to select from around 6 colours] " 

Avatar

Level 9

I mean the main component where I am trying to include other components[into corresponding divs in the component html] has a dialog wherein we can choose around 6 colours.

I just mentioned this because I was not sure if that had any role to play here.

Avatar

Level 10

It should not be a problem, you can have different dialogs for nested component ( when one components is included inside another )

Avatar

Level 9

Hi Praveen,

Ok, thank you for your reply.

So, if I understand correctly in my current scenario :

#1]component A which has its dialog. In this component html, I have to hard code certain components  of the same type into  corresponding div sections.

When I include the components, then ideally I should be able to edit them and nothing else to be done. Correct?

#2] In my case I am able to edit child components when I explicitly add from sidekick, but not the hardcoded ones[I do not even get the edit option when I hover over them].

Will try and see if I get something. In case I am missing something, please do let me know.

Avatar

Level 10

1.Yes, to ensure try with the OOTB text component

** Make sure the component which u r trying to include in component html should have dialog