casly
December 15, 2020, 6:19pm
1
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.
ive tried: $column->blocks()->class() and $column->blocks()->layout()->class() didnt work for me
any idea?
texnixe
December 15, 2020, 6:42pm
2
If that doesn’t help, please post the complete layout loop, out of context it doesn’t make much sense.
casly
December 15, 2020, 6:50pm
3
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 ?>
texnixe
December 15, 2020, 6:54pm
4
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
casly
December 15, 2020, 7:02pm
5
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?
texnixe
December 15, 2020, 10:04pm
6
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
casly
December 15, 2020, 10:13pm
7
Worked like a charm, thanks again … I srsly dont know how I missed all the Documentations