Hello,
I use the Editor plugin in a structure and extend the image block in a custom block snippet.
All works perfectly, but in the structure, there is a toggle field that I need to retrieve from the block image and I have no idea of how to do it .
Here is the code in question to make it clearer:
page blueprint:
type: structure
fields:
size:
label: large
type: toggle
contentsection: fields/editor
snippets editor image.php
<?php if ($block->isNotEmpty()): ?>
<figure<?= attr(['class' => $attrs->css()->value()], ' ') ?>>
<!-- https://forum.getkirby.com/t/new-editor-referencing-image-metadata/15905/5 -->
<?php $image = $attrs->id()->toFile();?>
<?php $resized = $image->resize(500)?>
<!--Here: if page item->size()->bool() -->
<?php $resized = $image->resize(1000)?>
Thank you for any tips,