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

Weird content tree behaviour

Avatar

Avatar
Validate 1
Level 2
dimitrioss83126
Level 2

Likes

4 likes

Total Posts

6 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
dimitrioss83126
Level 2

Likes

4 likes

Total Posts

6 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
dimitrioss83126
Level 2

16-11-2019

Hello,

I'm struggling with a component content tree issue that I've got on my custom component.

I'll attatch a screenshot to make it simpler

Screenshot_5.png

My custom component named "Calendar Card Item" is injected via:

data-sly-resource

two other components are added inside it - Button and Text. Unfortunately, in the content tree they are not below the Calendar Card Item, they are not nested. Is this a known issue?

I add like this:

<sly data-sly-resource="${'button' @ resourceType='test/package/components/button'}"></sly>

I tried replacing sly with div and adding a custom css class but it did not help. Does anybody got an idea what am I doing wrong?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 2
dimitrioss83126
Level 2

Likes

4 likes

Total Posts

6 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
dimitrioss83126
Level 2

Likes

4 likes

Total Posts

6 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
dimitrioss83126
Level 2

17-11-2019

I found the solution. I looked into ui.ContentTree.js that is responsible for creating the markup of the content tree.

A component is added as a sub-component of a component if the parent has set the cq:isContainer node to "true".

Then all the components that are added with data-sly-resource are added as childs of the parent component.

Answers (2)

Answers (2)

Avatar

Avatar
Validate 1
Level 2
dimitrioss83126
Level 2

Likes

4 likes

Total Posts

6 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
dimitrioss83126
Level 2

Likes

4 likes

Total Posts

6 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
dimitrioss83126
Level 2

17-11-2019

Hi Arun,

In the crx the nodes looks ok. They are nested properly.

Screenshot_9.png

So, you think it's an issue with the content tree itself, not with my component implementation?

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,279 likes

Total Posts

3,155 posts

Correct Reply

889 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,279 likes

Total Posts

3,155 posts

Correct Reply

889 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

16-11-2019

Hi,

Did you check the content tree nodes from CRXDE? The button and text data stores under the calendar card in the actual tree.

This could be an issue with the content tree to not showing under proper tree while components are nested.