Skip to content

Instantly share code, notes, and snippets.

@koentjuh1
Last active January 24, 2017 09:10
Show Gist options
  • Save koentjuh1/a95609bf13fd870eed7011a9e6fe700e to your computer and use it in GitHub Desktop.
Save koentjuh1/a95609bf13fd870eed7011a9e6fe700e to your computer and use it in GitHub Desktop.
DOIT CMS afbeelding grid galerij toevoegen met crop

Eerst bij entity pagina een grid veld images toevoegen(zie projecthuismanuitvaart)

'images' => array(
'type' => FIELD_TYPE_GRID,
'params' => array(
'required' => false,
'display' => 'content',
'text' => 'Afbeeldingen',
'text_tooltip' => '',
'columns' => array(
'image' => array(
'type' => FIELD_TYPE_IMAGE,
'name' => 'Afbeelding',
'crop' => array(
array(
'ratio' => '156x115',
'sizes' => array('156x115'),
),
),
),
),
),
),
<?php
if(strlen($object->images) > 0) {
grid($object->images)->each(function($image) { ?>
<a href="<?= WEBSITEPATH.ltrim($image['image']); ?>" rel="image-gal" class="fancybox" title="<?php echo $product->naam; ?>"><img src="<?= getCrop(ltrim($image['image'], '/'), '156x115'); ?>" alt=""></a>
<?php });
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment