i’m facing a problem how to be able to get an effect like in this example
I created a https://jsfiddle.net/ohdss4gh/2/ for a static solution, but i need the structure for a dynamic page. Do i need a modulo operation as a possible approach?
Or is there a way to choose the left or the right column via panel?
This is the code i have right now, but on click the row below the project slides to the bottom.
<main class="main" class="main" role="main">
<div class="content publications column-padding--outer border--bottom">
<?php
$subpages = page()->children()->visible();
// helper variable
$count = 0;
// loop through projects
foreach($subpages as $subpage):
// if the result of the modulo operation is 0, open new row
if($count % 2 == 0): ?>
<div class="row">
<?php endif ?>
<div class="col-1-2 padding-bottom--2rem">
<div class="swiper-container swiper-container--common">
<!-- Additional required wrapper -->
<div class="swiper-wrapper">
<!-- Slides -->
<?php
foreach ($subpage->images()->sortBy('asc', SORT_NATURAL) as $image): ?>
<figure class="swiper-slide">
<img src="<?php echo $image->url() ?>" alt="<?php echo $page->title()->html() ?>">
</figure>
<?php endforeach ?>
</div>
<!-- If we need navigation buttons -->
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div>
</div>
<div class="padding-top--1rem text-align--left">
<p class="click padding-bottom--1rem"><?php echo $subpage->title()->html() ?> ↗</p>
<div class="position--relative">
<div class="showup padding-bottom--2rem"><?php echo $subpage->text()->kirbytext() ?></div>
</div>
</div>
</div>
<?php
// if the result of the modulo operation is 1, close row
if($count % 2 == 1): ?>
</div>
<?php endif ?>
<?php $count++; endforeach ?>
</div>
</main>