How to resize image in editor snippet?

How can i resize the image inside the editor snippet?

$src is a string not a fileobject. Its the path to the image in de media folder not to the page dir.

<?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() ?>">
  </a>
  <?php else: ?>
  <img src="<?= $src ?>" alt="<?= $attrs->alt() ?>">
  <?php endif ?>

  <?php if ($attrs->caption()->isNotEmpty()): ?>
  <figcaption>
    <?= $attrs->caption() ?>
  </figcaption>
  <?php endif ?>
</figure>
<?php endif ?>
1 Like

Sorry that I missed that post, thanks for helping out and the beautiful Newsletters!

1 Like