Hi, I'm starting to use imagecache+imagefield to add images to nodes. The only thing I miss from image+image_attach is the possibility to browse and select an existing images before adding a new one.

Is there any cck field or hack to get this for imagefield?

Thanks in advance

Comments

Antoine Lafontaine’s picture

I've been pondering the same thing while working on a website. We actually decided to go for duplicate uploads since the image redundancy was minimal, but I had somewhat of an idea on how this could be achieved. This is untested but ought to work:

First you create and image/picture/photo content type in CCK. It should at least include an ImageField has a custom field. I was planing on adding some extra meta data at the same time (location coordinate, name of the photographer and so on, so add only the required fields)

Then , In any content type in which you want to attach images to, you insert a NodeReference CCK field linked to your image type content. Make this a multiple selection and use the multiselect module to make it easier to visualize which pictures are linked to the content. (could also use a view to filter the pictures available for the edited content if the amount of pictures in the system is somewhat overwhelming, a taxonomy based filtering is also possible I think)

The inconvenience of this approach is that you need to add the pictures using the create content interface (maybe a custom modal page could be overlaid using some ajaxy/jQuery magic to add images when it's not already in the system) and each picture becomes a node so this might become and overhead that is not acceptable (could probably be quite reduce by caching the content). I'm no expert in the performance department, so I'm not sure of how much overhead this might cause.

The advantages (I think) are numerous:
- No image duplicates (of course this is somewhat depending on the system users)
- good meta data handling
- very powerful categorization of your images using taxonomy (could also be used to create the folders on the server)
- expandable (fields can always be added to all images by editing the CCK content type)

I was also thinking of adding some jQuery "image tooltip" on the multiselect widget (probably by fetching a thumbnail sized picture generated with imagecache) in order to facilitate the image selection...

I'm sorry this is much less of a how-to than some kind of a brainstorming base.

Let me know what you think and I hope this helps you somehow.

Fayna’s picture

I wish this was available also! Maybe allow certain images to be tagged "Browsable" so you can browse for them later. If you have tons of images and all of them are browsable, you'd have to sift through them all to find the ones you want. Either way, reusing images that are already uploaded would be a great addition to ImageField!! :)

Edit: I thought there was a similar issue: http://drupal.org/node/119539.

dopry’s picture

You know it's not a feature currently and it won't be an interface I'll distribute until multiple files can be associated to a single node safely in drupal core. This will be a possibility in D7 if some version of hook_file lands in core.

dopry’s picture

Status: Active » Closed (fixed)