Post by unknownmale1 » Wed Sep 08, 2010 11:56 pm

I have this code in my products.tpl

Code: Select all

 <div align="left" class="lowercase"><strong>Change Views:</strong></div>
  
        <?php if ($images) { ?>
      <div style="display: inline-block;">
        <?php foreach ($images as $image) { ?>
        <div style="display: inline-block; float: left; text-align: center; margin-left: 5px; margin-right: 5px; margin-bottom: 10px;"><a href="<?php echo $image['popup']; ?>" title="<?php echo $heading_title; ?>" class="thickbox" rel="gallery"><img src="<?php echo $image['thumb']; ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" style="border: 0px solid #DDDDDD; margin-bottom: 3px;" /></a><br />
        </div>
        <?php } ?>
   <?php } else { ?>
      <div style="background: #F7F7F7; border: 1px solid #ff0000; padding: 10px; margin-bottom: 10px;"><?php echo $text_no_images; ?></div>
      <?php } ?>
    </div>
But if there is no image, instead of posting the default noimage.jpg its showing this:

Code: Select all

<div align="left" class="lowercase"><strong>Change Views:</strong></div> 
  
              <div style="display: inline-block;"> 
                <div style="display: inline-block; float: left; text-align: center; margin-left: 5px; margin-right: 5px; margin-bottom: 10px;"><a href="" title="mac coat" class="thickbox" rel="gallery"><img src="" title="mac coat" alt="mac coat" style="border: 0px solid #DDDDDD; margin-bottom: 3px;" /></a><br /> 
        </div> 
                <div style="display: inline-block; float: left; text-align: center; margin-left: 5px; margin-right: 5px; margin-bottom: 10px;"><a href="shop/image/cache/data/1-500x500.jpg" title="mac coat" class="thickbox" rel="gallery"><img src="shop/image/cache/data/1-100x150.jpg" title="mac coat" alt="mac coat" style="border: 0px solid #DDDDDD; margin-bottom: 3px;" /></a><br /> 
        </div> 
       
               </div> 
I can see it is not posting the url for no image in the src or href but i dont know why...

Any ideas?

Active Member

Posts

Joined
Sat Aug 28, 2010 6:46 pm

Post by unknownmale1 » Fri Sep 10, 2010 11:31 pm

Bump.

Any ideas anyone?

Active Member

Posts

Joined
Sat Aug 28, 2010 6:46 pm

Post by jayman » Sat Sep 11, 2010 5:02 am

the reason is the piece of code you are looking at is for the additional images in the tabs not the main product images. If you do use any additional images it will not show anything.

Another thing is it may actually help by stating what version of OC you are using and a link to the site can help wonders.

New member

Posts

Joined
Wed Apr 07, 2010 1:32 pm

Post by unknownmale1 » Sat Sep 11, 2010 5:14 am

I only posted the additional images code. the main image is in a separate section and showing fine.

It is on version 1.4.9

It is a live url, the maintenance page redirects to a holding page. If I were to take it off this mode to show people then the public would be able to see an unfinished site with test products etc.

Active Member

Posts

Joined
Sat Aug 28, 2010 6:46 pm

Post by jayman » Sat Sep 11, 2010 11:53 am

If you do not have additional images for your product it will not show anything including the default no images.

New member

Posts

Joined
Wed Apr 07, 2010 1:32 pm

Post by unknownmale1 » Sat Sep 11, 2010 5:06 pm

Hello, Yes i am aware.

I have 3 additional images. They are showing fine. I have also added a forth image, But not assigned it. So it should by default post the no_image.jpg.

But as you can see from the code above it is not posting the SRC or HREF url for some reason. So a broken image is showing. This problem will go away once an image is assigned but i would like the no_image.jpg to show when no image is assigned.

Thanks

Active Member

Posts

Joined
Sat Aug 28, 2010 6:46 pm
Who is online

Users browsing this forum: No registered users and 14 guests