SmartGallery-omeka-module/view/common/block-layout/smartGallery.phtml

69 lines
1.6 KiB
PHTML
Raw Normal View History

2021-09-07 11:01:22 +02:00
<?php
$this->headLink()->appendStylesheet($this->assetUrl('css/smartphoto.min.css',
'SmartGallery'));
$this->headLink()->appendStylesheet($this->assetUrl('css/style.css',
'SmartGallery'));
?>
<?php $image_id = 0; ?>
<div class="archive-item-block smart-gallery">
<?php if ($renderSourceLink) { ?>
<div class="source-link">
<a href="<?= $item_url ?>">Source</a>
</div>
<?php } ?>
<div class="wrapper">
<div class="masonry">
<?php foreach ($images as $image) { ?>
<?php $image_id = $image_id +1;
$img_id = $gallery_id . '-' . $image_id;
?>
<div class="brick">
<a href="<?= $image['media_url'] ?>"
class="<?= $gallery_id ?>"
data-caption="<?= $image['image_title'] ?>"
data-id="<?= $img_id ?>">
<img src="<?= $image['media_url'] ?>"
alt=""
item_url="<?= $image['item_url'] ?>"
width="250"
/>
</a>
</div>
<?php } ?>
</div>
</div>
<?php if ($title) { ?>
<div class="item_title">
<?= $title ?>
</div>
<?php } ?>
</div>
<?php
echo $this->inlineScript()
->prependFile($this->assetUrl('js/jquery-smartphoto.min.js?v=1"',
'SmartGallery'));
?>
<script>
jQuery(document).ready(function() {
$(function(){
$(".<?= $gallery_id ?>").SmartPhoto({
resizeStyle: 'fit',
});
});
});
function updateSourceURL(thumbnail){
$(thumbnail).closest(".archive-gallery")
.find('.source-link')
.find('a').prop('href', $(thumbnail).attr('item_url'));
}
</script>