Expand my Community achievements bar.

SOLVED

Component name is breaking when adding to a page

Avatar

Level 6

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
Community Advisor

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 Advisor

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 6

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 Advisor

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

Avatar

Correct answer by
Community Advisor

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.