Open fritzlaszlo opened 3 years ago
Hi,
The plugin comes from a time before Kirby introduced blocks. As such, I've not used the plugin in blocks yet. But that's definitively something to consider.
Nevertheless, the plugin actually works with some limitations:
In order to use the cropped image in your templates/snippets, one have to get the image's file and then call the plugin's file method croppedImage()
. So your code becomes this:
<?= $block->image()->toFile()->croppedImage() ?>
Using the starterkit and changing line 27 of /site/snippets/blocks/image.php
accordingly worked for me.
Hi there,
thanks for this fantastic plugin!
I ran into problems when using it with the new default image block. I tried to adapt the piece of code from your instructions to:
<?= $block->image()->croppedImage() ?>
But this throws an Error:Block error: "Array to string conversion" in block type: "image"
Any quick ideas or hints?