Kirby 3.5 Layout-Field

Hi guys, I just tried the new Layout-Field in Kirby 3.5 with an extra class-field

  settings:
  fields:
    class:
      type: text
      width: 1/2

So after I added something in the class-field on any object I can not access it, or I do not know how.
:neutral_face:

ive tried: $column->blocks()->class() and $column->blocks()->layout()->class() didnt work for me

any idea?

If that doesn’t help, please post the complete layout loop, out of context it doesn’t make much sense.

Its the exact same like on the Tut-page

<?php foreach ($page->layout()->toLayouts() as $layout): ?>
  <section class="grid" id="<?= $layout->id() ?>">
    <?php foreach ($layout->columns() as $column): ?>
      <div class="column" style="--span:<?= $column->span() ?>">
        <div class="blocks">
          <?= $column->blocks() ?>
        </div>
      </div>
    <?php endforeach ?>
  </section>
<?php endforeach ?>

Haven’t really played with layouts yet, but as far as I can see, the settings are on $layout, so probably $layout->class()? Or are these settings on the columns in your blueprint?

1 Like

Oh damn, I thought these fields would refer to the individual elements and not to the area
It works, thank you!

Do you maybe know how I can get fields on individual objects for example on “Text” or how I can create my own?

You can add add fields to block types, either extend the existing ones or create your own, you can find it in the blocks field documentation.

Or did you mean something else?

1 Like

Worked like a charm, thanks again … I srsly dont know how I missed all the Documentations