Attach multiple images to a node

marcoBauli - June 27, 2006 - 16:24

Hello everybody,

could any good soul enlight me on how to let final users attach *easily* more images to a node, and then output (show) them nicely as thumbnails in a block on the final node page?

I have considered almost all the possible Drupal solutions for handling images, but each one seems the piece of a big scattered puzzle...it let's you do one thing, but not the others...

This is what i considered:

[1] upload (or upload_image) + nodeimageblock
PROS:
+ possibility to attach more images to a node
+ possibility to show these images on the final node page
CONS:
- lacks thumbnail/preview images generation
- lacks any sort of theming of the output (it just throws images as they are one stitched roughly to another in a block)

[2] image + attach_image + CCK (or Flexinode)
PROS:
+ friendly User Interface
CONS:
- Possibility to attach only 1 image

[3] image + img_assist + CCK (or Flexinode)
CONS:
- way too complicated workflow for final users

[4] cck + imagefield
PROS:
+ possibility to attach more images to a node
CONS:
- the number of images available has to be set in advance in the content type
- does not generate thumbnails / previews

[5] image_tab
PROS:
+ possibility to attach more images to a node
CONS:
- not yet ready for 4.7
- uses a Tab to add images (not ideal, since Tabs are not that visible)


Any hint or advice about what i am looking to achieve is really apreciated!

cheers

my most consistent problem

Gundalo - June 27, 2006 - 17:10

This is my favorite gripe about drupal, and just about every site i've built using it (at least a dozen) needed image handling.

for one site, i built a custom module that uses only the upload module. When files are uploaded are images, it creates thumbnails, adds them as additional attachments (like image.module). however, it will do it for every attached image.

This method skips adding images as nodes, and is therefor meant for sites that don't need that added functionality.

This worked on the original site is was written for, but i haven't successfully ported it to another site.

i'll reply here when i've got something working.

thx

marcoBauli - June 28, 2006 - 10:02

thanks for considering this thepugh, i will do the same when i'll find a solution.

cheers

good work

sangamreddi - June 28, 2006 - 15:24

Could you post the code here?

Sunny                      
www.gleez.com | www.sandeepone.com

Tis a bit of a mess

willdashwood - July 27, 2006 - 15:25

It seems every Drupal site I come to do struggles at the stage of sorting out images. Does anyone know what the future plans are for Drupal and image functionality? Surely it's time to consolidate all the fragmented projects out there and come up with one or two modules which are flexible enough to do everything we need, customisable via a settings page.

It's this kind of thing which is hurting Drupal but I'd be willing to contribute as best I can if we can get these image problems sorted once and for all. image_attach.module would do the job for me if only I could attach more than one image per node.

The method I use for this is

high1memo - July 29, 2006 - 16:40

The method I use for this is using the categories module + CCK + image module - might not be the cleanest, but I'm happy with it.

PROS:

  • possibility to attach unlimited images to a node
  • automatically show these images on the node page (i usually theme node-content-foo.tpl.php and node-image.tpl.php to make it look nice)
  • automatically generate thumbnails / previews (the images are created via image module)
  • If you are viewing an image, in the taxonomy section it shows which node(s) it belongs to, clicking on the taxonomy will take it to the node details (with all other thumbnails) - so basically you have a link back to the node from the image,

CONS

  • I mention this after the step by step.

Below is a step by step how to create a nodetype called Artist which can have many images assigned to it.

Setting up:

  1. Create a custom CCK or flexinode node type (e.g. Artist - fields: name, dob, brief bio, etc. . all fields excluding anything to do with images) - you may have already done this.
  2. Create a container called Artist Photos which accepts nodetype Image
  3. In admin / settings / category under the Content type settings section enable other content types to be Categories
  4. In admin / settings / content types I click on the configure link next to my Artist node type
    1. Under the Category behavior: section tick Category
    2. Under the Category - allowed containers: select the containers Artist Photos

So now whenever we create a node of type Artist it will also act as a taxonomy term under the container Artist Photos.

So then we just create images as we normally would using the image module, and from the Categories section we select whichever Artist we want it to belong to and voila!

Only problem is: If you already have created a bunch of 'Artists' which you want to assign images to, those existing ones will not already be categories for images. The steps above only enable new Artists to be categories, so for each existing Artist you need to edit it, and without doing anything, just click Submit. That will force the category module to create a category from that Artist. If you have already created hundreds of Artists then you might wanna think of a way of automating this!!

 

 

Can it do many to many relationships?

mr john - September 23, 2006 - 18:44

I think this may work for me but I also need many-to-many relationships. For example, is there a way to have an art piece belong to more than one artist (like a collaberation)?

5.0

Zoologico - January 17, 2007 - 15:21

How would you do this with 5.0?

I don't know if this helps

rivena - July 30, 2006 - 17:27

I don't know if this helps you, but I used the image.module, upload.module, and image_attach (came with the image module in contrib). This displays all the uploaded images in a list after the node. I don't quite like how it displays (not side by side), but it's easy to do.

Anisa.

-----------------------------------------------------------
Kindness builds stronger bonds than necessity.

www.animecards.org - 18,000 card scans and counting!
-----------------------------------------------------------

Working on patch for this

Jax - October 7, 2006 - 21:34

You might want to have a look at this: http://drupal.org/node/87991, it implements what you ask for. If you have suggestions please add them to the feature request.

a helpful comparison / explanation of 2 techniques

isaac77 - November 6, 2006 - 17:51

this lullabot article is useful, though it might not take into account new tools that are still in development...

http://www.lullabot.com/articles/image_and_image_exact_sizes_vs_imagefie...

you can do that with my cck

MrTaco - December 1, 2006 - 19:37

you can do that with my cck subform module

create a new "image_holder" content type that contains an image field

then create a relation between your parent node type and this image_holder type

then create a subform field in your parent type, and tell it to operate on the relation you just established

http://subform.googlecode.com/svn/trunk/subform_trunk.zip

Subform is a CCK field

coupet - February 8, 2007 - 18:50

Subform is a CCK field type
http://drupal.org/project/subform

----
Darly

You can try the Node Images

stefano73 - December 1, 2006 - 20:11

You can try the Node Images module.

You can try the Node Images module.

coupet - March 19, 2007 - 14:31

Adds an Images tab to the node page, allowing users to add images to the node using the upload.module.

----
Darly

How do you set this parameter?

Zoologico - January 17, 2007 - 18:55

[4] cck + imagefield
PROS:
+ possibility to attach more images to a node
CONS:
- the number of images available has to be set in advance in the content type
- does not generate thumbnails / previews

How do you set the number of image. I find that I can only set whether or not Multiple Images are allowed, not how many.

Thanks.

Actually, I was trying to

shyamarjarapu - March 9, 2007 - 21:55

Actually, I was trying to get node content in this fashion

some text here

image 1

some text here

image 2

some more text here

well CCK + imagefield with multiple images help me to add more images however, it doesn't let me spread the content + images. I am currently using image,upload,tinymce,imce to help me solve this. As you can see we are lacking thumbnail preview here in teaser. I am going to adjust myself without any images in the preview

Image handling

sprintstar - March 18, 2007 - 10:56

Agreed, image handling is poor. I have used Image and Image Assist modules, but there are currently so many problems with them on Drupal 5 that they are currently unusable. I think Drupal should support images embedded (either origional or thumbnail) in nodes as core functionality, or at a least a module that is commonly used and reliable!

I agree. I too used

borstahusen - May 27, 2007 - 08:56

I agree. I too used img_assist but with Drupal 5.1 existing images don't show anymore.

Use the gallery module

rimian - June 10, 2008 - 05:26

Why not extend your content type to include an image gallery. Create your image gallery (with your multiple images) then with an auto complete form field associate that gallery with your node. So you'd have a table in your database with the node Id and the term ID of your gallery.

http://www.rimian.com.au
http://www.freelancewebdeveloper.net.au

 
 

Drupal is a registered trademark of Dries Buytaert.