Jump to content


Photo

Else/If Statement to Hide Enlarge Image Link


  • Please log in to reply
2 replies to this topic

#1 Lavern

Lavern

    Expert

  • Members
  • PipPipPipPipPip
  • 306 posts

Posted 01 January 2008 - 09:08 PM

Hello,

I need to be able to hide the enlarge image link on the product info page when there is no large product image.

Can anyone help me with this?

Here is the code I want to show when there is a large product image:

<a href="<?php ProductLargeImageSrc(); ?>" title="<?php ProductImageAltText(); ?> Richly Scented Candle" rel="lightbox"><img class="candle" src="<?php ProductSmallImageSrc(); ?>" alt="<?php ProductImageAltText(); ?> Richly Scented Candle" title="<?php ProductImageAltText(); ?> Richly Scented Candle" height="<?php ProductSmallImageHeight(); ?>" width="<?php ProductSmallImageWidth(); ?>" /></a><br /><a style="font-size: .8em; text-align: center; width: 99%;" rel="lightbox" href="<?php ProductLargeImageSrc(); ?>" title="<?php ProductImageAltText(); ?> Richly Scented Candle">Enlarge Image</a>

Here is the code to show when there is no large product image:

<img class="candle" src="<?php ProductSmallImageSrc(); ?>" alt="<?php ProductImageAltText(); ?> Richly Scented Candle" title="<?php ProductImageAltText(); ?> Richly Scented Candle" height="<?php ProductSmallImageHeight(); ?>" width="<?php ProductSmallImageWidth(); ?>" />

I would appreciate your help. My PHP knowledge is very limited and I am having some trouble getting this.
Lavern Gingerich
New Creation Designs
Website and Graphic Design Services

#2 Alex Girin

Alex Girin

    Avactis Support Team

  • Members
  • PipPipPipPipPipPip
  • 628 posts

Posted 02 January 2008 - 06:43 AM

Hello Lavern,

Thank you for your inquiry.

Try to replace
<a style="font-size: .8em; text-align: center; width: 99%;" rel="lightbox" href="<?php ProductLargeImageSrc(); ?>" title="<?php ProductImageAltText(); ?> Richly Scented Candle">Enlarge Image</a>
with
<a style="font-size: .8em; text-align: center; width: 99%; display: <?php (ProductLargeImageSrc()? "inline":"none";) ?>;" rel="lightbox" href="<?php ProductLargeImageSrc(); ?>" title="<?php ProductImageAltText(); ?> Richly Scented Candle">Enlarge Image</a>

Best Regards,
Alex Girin
Avactis Shopping Cart Team

#3 Lavern

Lavern

    Expert

  • Members
  • PipPipPipPipPip
  • 306 posts

Posted 02 January 2008 - 02:25 PM

I changed my code and it still doesn't work. I want to totally remove the enlarge image text link. Also the image is a link and I want to remove the link on the image too.

Here is my code:

<a href="<?php ProductLargeImageSrc(); ?>" title="<?php ProductImageAltText(); ?> Richly Scented Candle" rel="lightbox"><img class="candle" src="<?php ProductSmallImageSrc(); ?>" alt="<?php ProductImageAltText(); ?> Richly Scented Candle" title="<?php ProductImageAltText(); ?> Richly Scented Candle" height="<?php ProductSmallImageHeight(); ?>" width="<?php ProductSmallImageWidth(); ?>" /></a><br /><br /><a style="font-size: .8em; text-align: center; width: 99%; display: <?php (ProductLargeImageSrc()? "inline":"none";) ?>;" rel="lightbox" href="<?php ProductLargeImageSrc(); ?>" title="<?php ProductImageAltText(); ?> Richly Scented Candle">Enlarge Image</a>

Lavern Gingerich
New Creation Designs
Website and Graphic Design Services