Senior
Senior
TCTwill CMS
Created by Senior on 9/18/2024 in #👊support
How to specify medias crops for blocks.
Hi. I've got a block that accepts medias and want to set a crop for it. I've tried doing it within the parent model that the block would be added to but the changes never get saved despite the editor detecting the crop i've configured i.e. I add the block in the block editor, I select an image and set a crop but it never gets linked to the block instance and doesn't render. Am I missing something? Block:
<x-twill::medias
name="articleHeroImage"
label="Article Image"
/>
<x-twill::medias
name="articleHeroImage"
label="Article Image"
/>
Parent Model $mediasParams:
'articleHeroImage' => [
'desktop' => [
[
'name' => 'desktop',
'ratio' => 9/6,
],
],
],
'articleHeroImage' => [
'desktop' => [
[
'name' => 'desktop',
'ratio' => 9/6,
],
],
],
3 replies