<?php
$Cache = Alfred_Hod::cache();
$cacheKey = 'Gallery_List';

if(!$output = $Cache->load($cacheKey)):
	$this->placeholder('output')->captureStart();
?>



	<h1><?= $this->translate('#Image galleries#') ?></h1>
	<div class="row gallery">
	<?php foreach($this->galleries as $gallery) : ?>
		<div class="col-xs-4 col-md-3">
				
			<a href="<?= $gallery->url ?>" class="thumbnail">
			<?php 
			if($gallery->imageExists()){
				if($image = $gallery->getFirstImage() ){
					echo $this->image($image->getOriginal(),array('preset'=>'small','class'=>'img-responsive'));
				}
			}
			
			?>	
	<?= $gallery->name?>
			</a>
		
		</div>
	<?php endforeach;?>
	</div>
<?php
	$this->placeholder('output')->captureEnd();
	$output = $this->placeholder('output');
	$Cache->save($output,$cacheKey,array('gallery','gallery_galleries'));

endif; // cahche
echo $output;