Make placeholder invisible?

Hi,

I have a product listings site and each page will have a different amount of products on. I have 30 set up in 3 columns but if I have a page with 15 items to go on then I have 15 of these placeholders

Image

How can I get rid of them?

I’m not sure what you’re asking, but it’s difficult to guess anyway without seeing the code - and when I tried the site, I just got a notice saying “Closed for maintenance” or somesuch.

display: none

What makes more sense is not generating image tags when there are no products for them.

I don’t know how to do that

Well what’s generating them?

You only get that little icon when there’s an <img src=“something” and “something” doesn’t exist or is a bad path.

I’m assuming you have a back-end script dumping products into that part of the page? I would have that back-end script generate the HTML there so you only get as many images are there are products.

I have custom fields

<a href="<?php echo $link; ?>"><img src="<?php echo $image; ?>" alt="<?php echo $alt; ?>" /></a>

and so on

In that case you need to find a way for the PHP script to know how many products there are in the category and stop at that point, rather than carrying on giving broken images and links.

… or move over the 30 boxes limit if need it.

in other words: a php solution. which you will probably find in the php forum.

there is another way, a hack really: make a blank N/A picture to be displayed for the remaining unoccupied boxes. and make sure the returning results are never over 30 items.