I'm rebuilding a site I wrote in Ruby on Rails, in Drupal. It offers so much functionality out of the box, and with the modules out there, I've only come across one feature I cannot replicate in Rails.

It's a recipe site which allows the author of a recipe to attach an image to their "node." What I want is to allow other members of the site to attach images to that recipe node. Much like how Yelp works. Then, when viewing a recipe, you see a number of thumbnails and can click to see a larger version of any of those images.

I'm using the Image module, version 6.x-1.0-alpha3, which works great under Drupal 6.4. It does what I need in terms of letting the author post a picture of their recipe. I think they might even be able to post more than one, if configured correctly. But it won't let others post a picture.

I thought the Image Attach module might help me, but it only lets you attach an Image node already in the system to a recipe node. Which isn't what I was hoping for at all.

Can anyone suggest what I should do to get this to work? Is there a module that does this already? Would I be best advised to write a module, or hire someone to write a module, to do this?

Comments

teyser’s picture

Hi,
Do u want attach image to nodes means,just use the cck and cck filefield module for drupal 6................

Regards,
-Raj.

rayray’s picture

Thanks for the reply. But I don't think that will allow other users to attach images to a node, just the node's author. Am I mistaken?

markabur’s picture

being a newbie, i'm not sure exactly how to do it, but the approach i'd explore would be to think of the attaching process as an association. so, the images readers upload are actually nodes of their own that reference the recipe node. there is a node reference field for cck but what i don't know is if you could automatically pre-fill it with the node that the "attach image" block lives in. once the reader-submitted photos are in the system then views should be able to be used to display all images that reference the current recipe (using an argument?).

WorldFallz’s picture

if you want to allow users to attach pictures directly to the node, then afaik they will need edit permission to the node.

If you don't want them to have access to the node, you could let them attach pictures to comments (via the comment_upload module).

A second option would be to create another content type for these child images with a node reference field to have the user select which recipe they're submitting a picture for, then use a viewfield on the recipe node itself to display these pics.

Yet another option would be similar to the second option above but use one of the node relationship modules (ie node2node, node_hierarchy, node_relativity) to connect them to the main node.

i'd probably use the second option.

hope that helps...

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

rayray’s picture

Attaching pictures to the comments is a good idea, probably the closest to what I'm trying to accomplish, however imperfect.

I suspect your second option would work better, I just need to wrap my brain around it.