1

I'm working on a site where a current content type has six image fields, six title fields & six content fields. One field from each (one image, one title & one content) all make up one group, so in total there are six groups of these.

Is it possible to move these into a field collection? I just think it'd be tidier, make more sense & make it easier to maintain.

Also if this is possible, not only how do I do it but is it even wise to move content from a 'normal' field to a field collection like this?

1

You can do it with 3 step

  1. In your content type, creat new field collection
  2. Write one module, use function hook_node_presave(). In this function, you can copy data from old fields to new field collections.
  3. Go to page admin/content. Select your content type. Select all node. In tab UPDATE OPTIONS chose Publish selected content and submit. This action to do run code your module write in step 2.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.