3

I'm trying to create an image repository with Drupal, but I face some problems.
I want to create a node with several images attached, but since the relation between images to nodes can be many-to-many (an image can be attached to more than one node) I don't want to duplicate the same image on the server.
I've tried different solutions but none of them can really fit my needing.

  • Imagefield solution:

I can easily attach multiple images to a node, but it's hard to reuse the same image.
The best solution would be using filefield_sources, but it's a bit buggy (I can't find a way to use the IMCE integration in a proper way).

  • Image solution:

It has an image browser, but without search or folder tree, it can't be used with many images.

Did anybody face the same problem and found a good solution? Thanks in advance.

==UPDATE==

Example:

Product-1 - I can attach Image-A, Image-B, Image-C and Image-D (with image module or imagefield)
Product-2 - I can attach Image-E, Image-F, Image-G and Image-H

Product-3 - I want to attach Image-A and Image-F.
I need to upload them again or I can use Image Browse (part of the Image module) to display an image picker with ALL the images uploaded before (without any search filed or filter).
I see 8 images, I can pick Image-A and Image-F and attach them to the node.

What about Product-1200? At that time I could have 4000 images displayed in Image Browse: it would be really hard to find the one I need to attach to the node! I would like to find a better way to select the images!

==SOLUTION==

I created two content types: product and image.
Image has an imagefield field.
Product has a nodereference field. I mass imported all my images with imagefield_import.
I use nodereference_browser with a custom view with all the filters I need to search between Image nodes and select which one to reference.

1
  • If you found a solution to your problem, please post it as an answer to your question and mark it as the accepted answer:)
    – Laxman13
    Nov 3, 2011 at 12:56

3 Answers 3

3

I haven't tried something like this before, but one way to solve it would be to.

  • Create a node type to hold the images.
  • Create a node reference to the image node type.

This would allow you to have several nodes reference the same image node type. You would also be able to tag images and use views on them, if you wanted to display the images stand alone, in a gallery etc.

You would need to do some work, to theme the images the are referenced though the image node, but it shouldn't be a big deal.

5
  • Basically you described the usage of image module. The big deal is find a way to easily browse the images. Actually you can do this just with autocomplete or with Image Browser (that is a big frame with ALL the images listed). I was looking for something more usable with a large number of images.
    – notme
    Mar 12, 2011 at 13:22
  • @notme: With views, you can setup an Admin gallery you can use to browse all the images, by thumbnail, with lightbox etc if you want. Views + contrib modules can do all of this for you quite easily. Using nodes, you can create any type of filters and display you want.
    – googletorp
    Mar 12, 2011 at 13:33
  • My problem is not browsing images when they are uploaded, it's browse images BEFORE attach them to a node. I try to add some exemple to my question for better explaination.
    – notme
    Mar 12, 2011 at 14:06
  • 2notme, you don't understand, content type provided by googletorp used for adding images (internal using) for supporting relations, not for your current nodes.
    – Nikit
    Mar 12, 2011 at 23:33
  • again: it's not a relationship problem (I know how to manage them), but of usability. I ended up using nodereference_explorer, that allow me to display a modal view with a custom view to search between the nodes before associate them.
    – pasine
    Mar 14, 2011 at 9:19
2

I created two content types: product and image. Image has an imagefield field. Product has a nodereference field. I mass imported all my images with imagefield_import. I use nodereference_browser with a custom view with all the filters I need to search between Image nodes and select which one to reference.

0

On my opinion, the best way is to create a content type for images, attaching a taxonmy mechanism to it and to use both taxonomy and views to show appropriate images to the user.

Hope it helps !

David

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.