0

we'd like our staff to be able to add images to a content type whenever they add a new node to this specific content type. This is easily enough done with the image field. However, this requires a) for all of them to have the same images on their local computers, and b) it uploads multiple versions of the same image over and over again into the files directory. We just want one copy of each image on the site. Ideally, the staff would be able to select an image to use for the node they're creating from a repository somewhere on the drupal site itself (which then only keeps one copy of that image on the server).

It would basically work like a 1:M relationship in a database, with the image being the 1 and the nodes being the many.

Anyone know how this is possible? (preferably not using the IMCE module as that messes up my database configuration for some reason...)

1 Answer 1

1

You could use taxonomy easily enough.

  1. Create a vocabulary called Node Images
  2. Add an image field to the taxonomy term
  3. Add all your terms (just name and the image)
  4. Under manage display (for the term), set it up to only show the image field
  5. Under manage display -> full content (for the node), add the taxonomy reference field and set the format to Rendered taxonomy term <- (requires display suite)

On the content type that your staff uses, add a taxonomy reference field with a dropdown or autocomplete. When they create new content, they would be able to select the correct term/image to attach to the node. You would just need to initially add all the terms/images to the vocabulary.

6
  • Thanks, but would that actually display the image on the node view page or just a link to the image? We want it to display the image on the node view page.
    – Sage
    Commented Mar 17, 2015 at 1:33
  • It would display whatever you tell it do under Manage Display. I added step 4-5 to roughly go over that part Commented Mar 17, 2015 at 1:53
  • it only gives me options under format for link, plain text, and rss.
    – Sage
    Commented Mar 17, 2015 at 2:47
  • I also keep getting this error now: Undefined index: uri in theme_image_formatter()
    – Sage
    Commented Mar 17, 2015 at 2:49
  • Well it looks like that format comes from Display Suite, so you'll need to enable it to use. That actually surprised me Commented Mar 17, 2015 at 3:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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