Hi everyone,
i have two galeries in my blueprint for a project page, one for landscape images and the other for portrait images (not in all projetcs). They are both in a grid container with two colums, Iād like to change the class for portrait image (landscape span to the end and one portrait images by column.) It works with two foreach loops but iām sure there is a simple way to do this
Thanks,
Thibault
- width: 1/2
sections:
gallery:
headline: Gallerie paysage
type: files
template: image
layout: cards
alt:
label: Alt Text
type: text
image:
cover: true
ratio: 3/2
portrait:
headline: Gallerie portrait
type: files
template: portrait
layout: cards
alt:
label: Alt Text
type: text
image:
cover: true
ratio: 1/2
<section class="gallery-grid">
<?php foreach ($page->images()->filterBy('template', 'image')->sortBy('sort', 'asc') as $image): ?>
<div class="gallery-items">
<figure>
<img
src="<?= $image->url() ?>"
srcset="<?= $image->srcset() ?>"
/>
</figure>
</div>
<?php endforeach ?>
</section>
<section class="gallery-grid">
<?php foreach ($page->images()->filterBy('template', 'portrait')->sortBy('sort', 'asc') as $image): ?>
<div class="gallery-items">
<figure>
<img
src="<?= $image->url() ?>"
srcset="<?= $image->srcset() ?>"
/>
</figure>
</div>
<?php endforeach ?>
</section>