Created
April 8, 2016 16:57
-
-
Save javimata/099785dad78336e1febbdef9fc15799c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$array_images = array(); | |
$imagen = $this->item->imagenes; | |
$array_images[0] = $imagen; | |
$imagenes = json_decode($this->item->images); | |
if (count($imagenes)): | |
foreach ($imagenes as $key => $value) { | |
if ( $value!="" && JFile::exists($value) ): | |
array_push($array_images, $value); | |
endif; | |
} | |
endif; | |
if (count($array_images)==1): | |
if ($array_images[0]<>"" && JFile::exists($array_images[0])): | |
?> | |
<div class="imagen"> | |
<img src="<?php echo JURI::BASE(true) . "/" . $array_images[0]; ?>" class="img-responsive"> | |
</div> | |
<?php endif;?> | |
<?php else: ?> | |
<div class="imagen imagen-slick"> | |
<?php foreach($array_images as $imagen): | |
if (JFile::exists($array_images[0]) && $imagen!=""): | |
?> | |
<div><img src="<?php echo JURI::BASE(true) . "/" . $imagen; ?>" class="img-responsive"></div> | |
<?php endif; ?> | |
<?php endforeach; ?> | |
</div> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment