I have combed the forums and interrogated the people in #drupal-support.... so far i have not found or possibly overlooked the solution to my "ambiguously easy" image gallery problem.

I am in search of a simple way to add an image gallery to custom node types (node-example.tpl.php). Essentially a user-roll of my choice needs to be able to create content by selecting the appropriate node type of their choice. Upon creation all users that have permissions will then be able to "edit the node" and simply upload images to the node's gallery ... and then choose what picture will appear as the "showcase pic" which will be the main picture of the node.

This procedure will work for many different purposes ... however the project i am currently working on is a real estate site. where agents need to be able to login ... and simply add a property node.

I have looked at node_image.module but i havent been able to get it working. I install it and enable it ..... and then go to add an image and when i hit upload or submit nothing happens. The page changes like it should when you hit submit but the image is not added to the node's gallery.

If anyone can simply point me in the right direction i would be grateful ... i have also tried image attach .. and cck to just add an image field. I am sure that there is a way for me to use cck and views to implement this ... i haven't gotten the courage to attack the problem head on ... because i quite frankly dont know where to start...

Anyways thanks!

evolvedideas

Comments

katbailey’s picture

Here are a couple of ways you could approach this, probably neither ideal, but might help you get started...
1. Use a separate content type for images, so that images are nodes by themselves, and use nodereference to add a reference back to the main node (the 'property' node). So you could define a CCK content type called 'Image', give it an imagefield field and a nodereference field. Each time an image is added it is referenced to a particular property and then on that property's node page, you would have a view of images, with an argument defined on nodereference. As for setting the 'showcase pic', this could be an on-off field in the image content type, but there'd be no way to ensure there was only one per property.
2. Don't have separate image nodes but add CCK imagefields to your property content type. You could have one single value imagefield for the showcase pic and a multiple value field for the others. Of course, changing the showcase pic would then be a bit cumbersome with this method.

Anyway, just a couple of thoughts on it, hope they help.

Katherine

criznach’s picture

If you don't want the image nodes clogging up your content list, the CCK+imagecache method is a good way to go. This may not be an issue for you, but I don't think this supports re-arranging of the images.

evolvedideas’s picture

Well i have come to the point where i am trying to use cck with a multiple value image field and the cck_multimage.module. Still not getting the desired result though. The images aren't showing aup at all and i haven't figured out the gallery switching yet either.

also one thing i am not understanding is ....

If i use views to create the gallery inside the node .... wouldn't i have to create a new view for each gallery? because i would have to have a filter for each node referenced image?

i am going to try using imagecache and CCK image fields .... that will work .. but now i must put in the gallery and have the humbnails enlarge onto the main picture div......

if anyone else has some ideas that would be greatly appreciated ... or perhaps knows how to get node_images.module working.....

thanks

www.evolvedideas.net

Providing solid evolved online solutions to any variety of ideas.

katbailey’s picture

Just to clarify how you would do this with views, you would only need to create one view. It would be a view of cck image nodes. From the arguments drop-down list when building the view you would select 'Node Reference: name_of_your_noderef_field'. Then in your argument handling code you would need something like:

if(!$args[0] && is_numeric(arg(1)) {
  $args[0] = arg(1);
}
return $args;

This is so that the nid can be passed to the view when it's in a block, as opposed to a page, where it can access the argument directly, as you could set the page url to be something like properties/$arg/gallery (see http://drupal.org/node/54455 for a much clearer explanation of how to use arguments in Views ;-))
Filter the view to only select the image node type and whatever other filters / sort criteria would be required.
Enable the block of this view for property view pages and it will pull in all image type nodes which have a noderef to the nid of whatever property is being viewed.
Does that make sense?