I’m modifying the ‘image’ snippet of the standard Kirby Editor plugin (v1.0.4) but getting an exception error when I append ‘srcset()’ to the image ‘$src’.
<?php if ($block->isNotEmpty()): ?>
<figure<?= attr(['class' => $attrs->css()->value()], ' ') ?>>
<?php if ($attrs->link()->isNotEmpty()): ?>
<a href="<?= $attrs->link()->toUrl() ?>">
<img
src="<?= $src ?>"
alt="<?= $attrs->alt() ?>"
sizes="(min-width: 600px) 50vw, 600px"
srcset="<?= $src->srcset() ?>"
>
</a>
<?php else: ?>
<img
src="<?= $src ?>"
alt="<?= $attrs->alt() ?>"
sizes="(min-width: 600px) 50vw, 600px"
srcset="<?= $src->srcset() ?>"
>
<?php endif ?>
<?php if ($attrs->caption()->isNotEmpty()): ?>
<figcaption>
<?= $attrs->caption() ?>
</figcaption>
<?php endif ?>
</figure>
<?php endif ?>