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

SOLVED

I would like to customize the name of the node stored in the multifield.

yeongjunk603901
Level 1
Level 1

I saw that item0, item1, and item2 are created as subnodes through the composite option in AEM 6.5 multifield.

But I want to change the name of the node created in the child node. I want to name the subnode 0,1,2.

If the data-granite-coral-multifield-composite attribute exists in html, item0, item1, item2 is created in name.

1831039_pastedImage_0.pngSo I looked at coral3 javascript for custom. (http://localhost:7502/crx/de/index.jsp#/libs/clientlibs/granite/coralui3/js/all.js )

However, the part that creates the '2' name attribute of the picture did not understand.

If you look at the log, the tag is created at some point.

1831046_pastedImage_2.png

1831048_pastedImage_6.png

I know that setting the dialog alone is not possible. (Node name change with coral multifield in AEM 6.4 )

Is there a way to rename the subnodes?

1 Accepted Solution
Arun_Patidar
Correct answer by
Community Advisor
Community Advisor

I would say right a listener to listen for specific path on create and filterout with name and and node type and rename the node name if it contains item0, item1 etc.

ResourceChangeListener (Apache Sling 9 API)

View solution in original post

4 Replies
antoniom5495929
Level 7
Level 7

Hi,

Sorry but I don't think that this is the best approach.

Why do you need to change it? If you need to change it just for stylesheet option, I can suggest you to proceed by changing your style or js file.

Let us know.

Thanks,

Antonio

Umesh_Sondhi
Community Advisor
Community Advisor

hi

I wouldn't not recommend you to do so however ,you want to stick with renaming the same you can check this article for the same

https://stackoverflow.com/questions/4164995/how-can-you-change-the-name-of-a-jcr-node

thnks !

Arun_Patidar
Correct answer by
Community Advisor
Community Advisor

I would say right a listener to listen for specific path on create and filterout with name and and node type and rename the node name if it contains item0, item1 etc.

ResourceChangeListener (Apache Sling 9 API)

View solution in original post

yeongjunk603901
Level 1
Level 1

Thank you very much for your response.

Can you tell me why I shouldn't change the child node name?

In previous versions, the nodes of the multifielded content were 0,1,2,3. I want to keep this content.

Renaming subnodes is not recommended, so I'll gradually remove them.