On /admin/config/people/accounts/fields page, there is an optional multi-value image field field_proof_images. There is a content type Proof, I reuse the field_proof_images in Proof. Then on /node/add/proof page, I want the field_proof_images to be automatically filled with the images from field_proof_images in the user accounts.

How to make this in Drupal 7?


You can prepopulate from other content through Tokens and Entityreference field. Here's a tutorial: Automatically Populate Drupal Fields From Other Content.

I don't know if it works with images but I don't see why it wouldn't. Not sure about the multi-value fields, you can try and see.

For a custom module solution you can lean on Prepopulate.

In Drupal 8 you can create a custom Media Entity browser that would show only the current user images from that field, then you might be able to choose them, or maybe even set as default.

Saving the images into the Content types ensures that if the user changes their user images it won't affect the Proof content. But if you want to always have them the same then you shouldn't add that to the Proof content at all. Simply create a contextual Views Block that would always display the content author's proof images and display it on the Proof nodes.

| improve this answer | |
  • I'd tried your suggestions before I asked here. None of yours works. Thank you all the same! – fishfree Nov 1 '18 at 5:13
  • You should have added the steps you tried and where you got stuck to your question. Add all the relevant information to increase your chanced of getting an answer. – prkos Nov 1 '18 at 14:04

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.