plain-solutions-gmbh / kirby-column-blocks

Use columns in block fields based on the layout field.
MIT License
35 stars 0 forks source link

Layout null blocks/columns.php #4

Closed Reluma closed 1 year ago

Reluma commented 1 year ago

I noticed that if I don't select the column type the plugin returns an error. I thought of changing the code like this. I hope it can be useful.


<?php $layout = $block->layout()->toLayouts()->first() ?>

<?php if ($layout !== null): ?>

  <div class="pure-g" id="<?= $layout->id() ?>">

    <?php foreach ($layout->columns() as $column): ?>

      <div class="pure-u-1  pure-u-lg-<?= $column->span() ?>-12 box2 blocks default wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0.2s">

        <?= $column->blocks() ?>

        </div>

    <?php endforeach ?>

  </div>

<?php endif ?>
plain-solutions-gmbh commented 1 year ago

It's fixed in Version 1.0.2. Thanks for your suggestion.