jeudi 22 septembre 2016

Blank page diagnose. IF problems

What I'm trying to do is add a elevatezoom gallery and create those little squares based on the result they get from mysql(if photo1 is set to any location then square1 appears , if photo2 is set to a location , square 2 appears , if photo3 is empty , nothing appears(you get the idea)

The problem is , after the next edits , I'm getting a blank page.

This is the whole code .

    <?php use_helper("StaticUrl");?>
<div class="product_image">
    <?php 
      $href = url_for($product->getRouteUrl(ESC_RAW));
      if ($sf_context->getActionName() == 'view')
    {
      $href = static_url_for($product->generatePhotoPath('large',ESC_RAW));
    }
    ?>

  <a <?php echo $sf_context->getActionName() == 'view' ? 'class="lightbox"' : ''; ?> href="<?php echo $href;?>" title="<?php echo $product; ?>">
        <img src="<?php echo  static_url_for($product->generatePhotoPath(ESC_RAW)); ?>" alt="<?php echo $product; ?>" data-zoom-image="<?php echo  static_url_for($product->generatePhotoPath('large',ESC_RAW)); ?>" class="zoom" style="z-index:999999;" />
  </a>

  <?php 
   $resultt  = Doctrine_Query::create()->from("Product")
                          ->select("photo1")
                          ->where("id = ?", $product_id)
                          ->fetchOne(array(), Doctrine_Core::HYDRATE_ARRAY);
    if (empty($resultt))
    {
       return sfView::NONE;
    }  

?>

    <?php if(isset(resultt)){  ?>
  <div id="gal1">

  <a href="#" data-image="<?php echo  url_for($product->generatePhotoPath("small", 1, ESC_RAW)); ?>" data-zoom-image="<?php echo  url_for($product->generatePhotoPath("large", 1, ESC_RAW)); ?>">
    <img id="img_01" src="<?php echo  url_for($product->generatePhotoPath("small", 1, ESC_RAW)); ?>" />
  </a>

    <?php } ?>

  <a href="#" data-image="<?php echo  url_for($product->generatePhotoPath("small", 2, ESC_RAW)); ?>" data-zoom-image="<?php echo  url_for($product->generatePhotoPath("large", 2, ESC_RAW)); ?>">
    <img id="img_01" src="<?php echo  url_for($product->generatePhotoPath("small", 2, ESC_RAW)); ?>" />
  </a>

  <a href="#" data-image="<?php echo  url_for($product->generatePhotoPath("small", 3, ESC_RAW)); ?>" data-zoom-image="<?php echo  url_for($product->generatePhotoPath("small", 3, ESC_RAW)); ?>">
    <img id="img_01" src="<?php echo  url_for($product->generatePhotoPath("small", 3, ESC_RAW)); ?>" />
  </a>

</div>
</div>

<script src="/js/elevatezoom/jquery.elevatezoom.js" type="text/javascript"></script>

Aucun commentaire:

Enregistrer un commentaire