So here's what I'm trying to do...

Take a look at this page:
http://www.mentalfabrications.com/dev/projects/caya/2

I want to make each thumbnail change the large image to its respective image when clicked. I've tried everything I can think of (I don't know any php) to get that to work and I thought I had it, but alas, to no avail. What I'm currently doing is using views to create a page view which displays the text. Then there's an attachment view for the group of thumbs, and finally, an additional attachment view for the large image. There are two arguments passed from the url - The project title (caya) and a number. If no number is found, it defaults to 0. I got that to work, by creating a numeric field using cck for my "project" content type, and then my argument type is based off of that numeric field. Not the cleanest method, but it works as far as getting the arguments accepted. I'm open to suggestions on ways to clean that up as well.

So my method for getting the large image to display is as follows. The way the images are uploaded into the "project" content type is as one field with a max of 7 and at least 1 required. So they are all from the same field. So to get only one large image to display, I check the "Group multiple values" box and select display "1" value starting at "%2". But it doesn't seem to understand the use of an argument there. I know the argument itself is populating correctly because I have the large image set to a link "projects/%1/%2" and if you hover over the large image it will display the correct url based on the actual page's url. For instance http://www.mentalfabrications.com/dev/projects/caya/3 displays "3" on hovering. But the image never changes from the first image! If I hard code it to display "1" value, starting at "2" or any other number, it displays that image fine, but I don't know how to dynamically populate that image field!

I'm sure there's a way easier method to use, but I'm a bit of a drupal novice...

Any help would be greatly appreciated.

Thanks,
iLan

*Edit* Also, the thumbs are hard-coded to their respective url's. Those are not being dynamically generated. Just to clarify*

Comments

thepuzzlemaster’s picture

Another thought, is there a way to hide content based on the argument result? I could create numerous versions of the large image, one for each image in the set, and then hide the ones that don't match the argument so only one of them displays. But I'm not sure if that's possible.

Any thoughts?

thepuzzlemaster’s picture

Well I figured out a way to do it... I changed it from one image upload field with a max of 7, to 7 separate image upload fields. Then I added additional blocks for each potential large image. I kept that 2nd argument as an image #, and hard coded the thumbs to those numbers. Then I learned a little php to write my own validation code for each block for the large images.

if ( $argument == x ) {
return TRUE;
} else {
return FALSE;
}

where x is the image number.

So, if the user clicks on thumbnail 2, it would take them to mydomain.com/projects/projectName/2
All image blocks would return false except for #2.

I don't think it's the cleanest and I wish there was a more dynamic way to do it (it wouldn't work if the user could upload an unlimited number of images), but it works.

Still accepting any thoughts or tips if anyone can think of a cleaner way to do this...