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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Component name is breaking when adding to a page

Avatar

Level 3

Hi,

 

When we are adding a component, it's name is breaking in the node structure and due to which some functionality is not working.

 

Component :

akhilr48142671_0-1658893950431.png

akhilr48142671_1-1658893967959.png

 

When we add it to a  page, it should look like below,

 

Expected:

akhilr48142671_2-1658894015660.png

 

Actual:  global_nav_categorie          - last word s is missing.

 

Any idea where we can check it?

 

1 Accepted Solution

Avatar

Correct answer by
Level 7

I could see the same behavior in my local. Components that are dragged and dropped, the length of node name is restricted to 20 characters(excluding _ in end and random number). But that should ideally not impact any functionality because the name of node for a component is random and its functionality works based on Sling resolution. For example if you drag and drop the same component again, its name would be global_nav_categorie_RANDOM_NUMBER. 

 

If somewhere you are referring this node name, then you should use cq:template and refer the exact same name i.e. global_nav_categorie or refer same name in structure/initial of editable template. It should work fine.

Also if there is no restriction, I think you can change the name of the component and limit its name to max 20 characters. 

View solution in original post

4 Replies

Avatar

Employee

Can you check and confirm, if you dont have another component with name "global_nav_categorie" (without s)?

 

I noticed that your component global_nav_categories is part of group General, so check if you may have created another component with the same name (without s) and make it part of your project group.

Avatar

Level 3

Hi @Mohit_KBansal ,

We don't have anything with "global_nav_categorie".

It will come to content/jcr:content  with mentioned name once we add the component to page

Avatar

Employee

@akhilr48142671 So the resourcePath is pointing to your component when you place it on content/jcr:content?

Avatar

Correct answer by
Level 7

I could see the same behavior in my local. Components that are dragged and dropped, the length of node name is restricted to 20 characters(excluding _ in end and random number). But that should ideally not impact any functionality because the name of node for a component is random and its functionality works based on Sling resolution. For example if you drag and drop the same component again, its name would be global_nav_categorie_RANDOM_NUMBER. 

 

If somewhere you are referring this node name, then you should use cq:template and refer the exact same name i.e. global_nav_categorie or refer same name in structure/initial of editable template. It should work fine.

Also if there is no restriction, I think you can change the name of the component and limit its name to max 20 characters.