Hi,

I'm using the 'views' module to display amazon products in a table view. However, some of the amazon entries don't have images, which can mess up tables depending on the browser. For example, IE6 displays the entire alt/title on one line, in replace of the missing image, messing up the entire column which results in extending the width of the table cell where the images reside.

Is there any way to hack the display code (which I guess is within amazon_views.inc) to insert a placeholder image whenever there is not one associated with the entry?

Brad

Comments

BradM’s picture

I think I've answered this for myself.

Edit amazon_views.inc

Before the line:
$image = theme('image', $value, $alt, $title, $attributes, FALSE);

Add this:
if ($value == '') { $value = 'placeholder.gif'; }

Put this placeholder.gif (or whatever you call it) in the root of your drupal installation.

Probably need to do this for other views too.

BradM’s picture

Priority: Minor » Normal

Sorry to bug you guys.

However, I now see that the medium placeholder image (missingm.gif) doesn't display correctly.

For some reason, the script is putting "node" within the image path.

So instead of /drupal/modules/amazontools/images/missingm.gif it is /drupal/node/modules/amazontools/images/missingm.gif

Maybe this explains why I had to do the hack above. For those images, the image url just shows up as the root of the installation (ie. /drupal) but with no image information at all.

Timotheos’s picture

BradM’s picture

Thanks for pointing that out, it fixed the missingm.gif graphic problem for me.

Prometheus6’s picture

Status: Active » Closed (fixed)