hi,
when using views with "group multiple values", a thumbnail and arguments, is there any way to control which image is used for the main thumbnail?
thanks sander
You would need to edit the theme function for the view (the one generated by the theme wizard) to take the list of fields in a given row and randomize it, using array_rand() or similar.
On Tuesday 01 April 2008, sander-martijn wrote:
any thoughts on this?
sander-martijn wrote:
hi,
when using views with "group multiple values", a thumbnail and arguments, is there any way to control which image is used for the main thumbnail?
thanks sander
Thank you larry, I was beginning to think I wouldn't get a response. The option of random probably won't please the client, but at least it's a start. And if they're not happy with that and want to select an image, at least I know where to start - I would imagine adding a cck field for selecting the image and then using a theme function for the view would be a combination that could work.
.s
Larry Garfield wrote:
You would need to edit the theme function for the view (the one generated by the theme wizard) to take the list of fields in a given row and randomize it, using array_rand() or similar.
On Tuesday 01 April 2008, sander-martijn wrote:
any thoughts on this?
sander-martijn wrote:
hi,
when using views with "group multiple values", a thumbnail and arguments, is there any way to control which image is used for the main thumbnail?
thanks sander
Hm, somehow I invented the word "random" in there. Not sure how. :-)
I'm not sure, though, how you'd want it controlled. The admin workflow will inform how you build it. You could just as easily have the view throw out all but the first image, for instance, if you wanted to only use the first image in the view. If you want it to be admin-selected, you could give them a separate CCK numeric field where they enter the offset (0-based, of course) of the image to use, but the usability of that option leaves something to be desired. At that point, I'd suggest that a multi-value CCK field is the wrong way to store the images in the first place.
On Tuesday 01 April 2008, sander-martijn wrote:
Thank you larry, I was beginning to think I wouldn't get a response. The option of random probably won't please the client, but at least it's a start. And if they're not happy with that and want to select an image, at least I know where to start - I would imagine adding a cck field for selecting the image and then using a theme function for the view would be a combination that could work.
.s
Larry Garfield wrote:
You would need to edit the theme function for the view (the one generated by the theme wizard) to take the list of fields in a given row and randomize it, using array_rand() or similar.
On Tuesday 01 April 2008, sander-martijn wrote:
any thoughts on this?
sander-martijn wrote:
hi,
when using views with "group multiple values", a thumbnail and arguments, is there any way to control which image is used for the main thumbnail?
thanks sander
I think from a usability perspective having a cck checkbox on the images and it uses the first image it finds that is checked would be best. If they only have one photo checked it would use that.
Larry Garfield wrote:
Hm, somehow I invented the word "random" in there. Not sure how. :-)
I'm not sure, though, how you'd want it controlled. The admin workflow will inform how you build it. You could just as easily have the view throw out all but the first image, for instance, if you wanted to only use the first image in the view. If you want it to be admin-selected, you could give them a separate CCK numeric field where they enter the offset (0-based, of course) of the image to use, but the usability of that option leaves something to be desired. At that point, I'd suggest that a multi-value CCK field is the wrong way to store the images in the first place.
On Tuesday 01 April 2008, sander-martijn wrote:
Thank you larry, I was beginning to think I wouldn't get a response. The option of random probably won't please the client, but at least it's a start. And if they're not happy with that and want to select an image, at least I know where to start - I would imagine adding a cck field for selecting the image and then using a theme function for the view would be a combination that could work.
.s
Larry Garfield wrote:
You would need to edit the theme function for the view (the one generated by the theme wizard) to take the list of fields in a given row and randomize it, using array_rand() or similar.
On Tuesday 01 April 2008, sander-martijn wrote:
any thoughts on this?
sander-martijn wrote:
hi,
when using views with "group multiple values", a thumbnail and arguments, is there any way to control which image is used for the main thumbnail?
thanks sander