Expand my Community achievements bar.

SOLVED

Content breaks when moving or editing a component

Avatar

Level 1

Everytime I move or change a property of a resource on my template all existing content break because the content still refers to the old resources.

For example I moved a component from components/content/ to components/structure.

Is there a way to update all content resources as well? So it won't reference components/content anymore but the newly update components/structure?

Thanks

1 Accepted Solution

Avatar

Correct answer by
Level 10

yes, it breaks as the resourceType path will be changed in the references. As @scott mentioned, you can update the reference manually if the magnitude of the content is less else you can quickly right a service which search for a resourceType and update with the right path using JCR APIs.

View solution in original post

2 Replies

Avatar

Level 10

When you define a template and a component - the template references the component. That is - the ResourceType -- which is the component's path that is assigned to the template. Moving the component will break the reference between a template and a component.

Its not really good to move a components path. But if you have to sometime - you need to update the ResourceType of the component. To do that - you can do it manually in CRXDE lite. Or you can modify the properties using the JCR API. 

Avatar

Correct answer by
Level 10

yes, it breaks as the resourceType path will be changed in the references. As @scott mentioned, you can update the reference manually if the magnitude of the content is less else you can quickly right a service which search for a resourceType and update with the right path using JCR APIs.