I am using Views Slideshow Module in ThumbnailHover mode, it needs a single view field to get its thumbnails, so I need to combine two fields into one (an imagecache image field and a regular image field) such that if the regular image field is empty the view field displays the imagecache thumbnail. That way if the user supplies a thumbnail it overrides the imagecache generated thumbnail. Does anyone know how to combine the two view fields into one?

Comments

intyms’s picture

Status: Active » Postponed (maintainer needs more info)

exclude from display your fields.
add a "global: custom text" field.
write the following code inside of the CustomText field:

<div class="slideshow-container">
  <div class="img-imagecach">
     [field no.1]
  </div>
  <div class="img-regular">
     [field no.2]  
  </div>
</div>

field no.1 and field no.2 you will find below the text area where you have to put this code.

set back to active or change to fixed when you test this solution.

captaindav’s picture

Thanks for your response. I ended up doing something similar:

1. Install the Views Custom Field Module

2. Entered the following PHP code into a Views Custom Field:

<?php

$nd=node_load($data->nid);

if( count($nd->image_thumbnail[0]) > 1) {
  $filepath = $nd->image_thumbnail[0]['filepath'];
  $filename = $nd->image_thumbnail[0]['filename'];
} else {
  $filepath = $nd->field_image[0]['filepath'];
  $filename = $nd->field_image[0]['filename'];
}

$alt = $nd->field_image[0]['data']['alt'];
$title = $nd->field_image[0]['data']['title'];

print theme('imagecache', 'Your ImageCache Preset Name', $filepath, $alt, $title);

?>

Note that in my case I had "field_image" and wanted to use its automatically generated imagecache thumbnail for the HoverThumbnail unless another (over-riding) thumbnail was uploaded in the "field_image_thumbnail" field.

captaindav’s picture

Status: Postponed (maintainer needs more info) » Fixed
intyms’s picture

@#2 captaindav
Thanks for posting.
Nice solution!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.