inject-gallery.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /**
  3. * @var $this \yii\web\View
  4. * @var $gallery \app\models\front\Gallery
  5. */
  6. use yii\helpers\Html;
  7. ?>
  8. <?php if($gallery instanceof \app\models\front\Gallery && count($gallery->getBehavior('galleryBehavior')->getImages())>0 ):?>
  9. <div class="gallery-wrapper" id="gallery-<?=$gallery->id?>">
  10. <div class="gallery-view splide">
  11. <div class="splide__track">
  12. <ul class="splide__list">
  13. <?php
  14. foreach($gallery->getBehavior('galleryBehavior')->getImages() as $image):/** @var $image \app\forks\galleryManager\GalleryImage */ ?>
  15. <li class="splide__slide">
  16. <?php if(!is_null($image->name) && $image->name!=""):?>
  17. <span class="image-capture"><?=$image->name?></span>
  18. <?php endif;?>
  19. <img src="<?=$image->getUrl('medium')?>" alt="<?=$image->name?>" loading="lazy" data-original="<?=$image->getUrl('large')?>">
  20. </li>
  21. <?php endforeach;?>
  22. </ul>
  23. </div>
  24. </div>
  25. <div class="gallery splide" style="padding-bottom: 18px; margin-bottom: 0px;">
  26. <div class="splide__track">
  27. <ul class="splide__list">
  28. <?php
  29. foreach($gallery->getBehavior('galleryBehavior')->getImages() as $image):/** @var $image \app\forks\galleryManager\GalleryImage */?>
  30. <li class="splide__slide">
  31. <img src="<?=$image->getUrl('small')?>" alt="<?=$image->name?>" loading="lazy">
  32. </li>
  33. <?php endforeach;?>
  34. </ul>
  35. </div>
  36. </div>
  37. <div class="image-title"><?=$gallery->name?></div>
  38. </div>
  39. <?php endif;?>