`Sebastlan
01/06/2022, 9:14 AMHarings Rob
01/06/2022, 9:33 AMHarings Rob
01/06/2022, 9:35 AM$block->images('mediaFieldName', 'cropNameFromBlocksConfig')Harings Rob
01/06/2022, 9:35 AM`Sebastlan
01/06/2022, 9:56 AM{{ $block->images('image', 'free') }}
htmlspecialchars(): Argument #1 ($string) must be of type string, array given`Sebastlan
01/06/2022, 10:01 AMkalle
01/06/2022, 10:11 AM{{ $block->image('image', 'free') }}
Since you want multiple images use native foreach for looping since {{ $block->images('image', 'free') }} returns array.
Check this method https://github.com/area17/twill/blob/17390bb6f5c5f14f92d97ec5a7881f5e5d382a45/src/Models/Behaviors/HasMedias.php#L121`Sebastlan
01/06/2022, 10:13 AMkalle
01/06/2022, 10:18 AM@php $images = $block->images('image', 'free'); @endphp and access to this array later in code.
Idk if we have here more native Twill way of doing this.`Sebastlan
01/06/2022, 10:25 AM`Sebastlan
01/06/2022, 10:25 AMkalle
01/06/2022, 10:26 AM`Sebastlan
01/06/2022, 10:27 AM`Sebastlan
01/06/2022, 10:41 AM@php
$images = $block->images('image', 'free');
@endphp
dd($images)
its emptyHarings Rob
01/06/2022, 10:42 AM`Sebastlan
01/06/2022, 10:44 AM@formField('medias', [
'name' => 'image', // role
'label' => 'Image',
'withVideoUrl' => false,
'translated' => false,
'max' => 6,
])kalle
01/06/2022, 10:55 AM`Sebastlan
01/06/2022, 10:57 AM`Sebastlan
01/06/2022, 11:00 AMifox
01/06/2022, 11:54 AMdd($block->medias)`Sebastlan
01/06/2022, 12:25 PMifox
01/06/2022, 12:27 PMifox
01/06/2022, 12:28 PMdd(config('twill.block_editor.crops'))?`Sebastlan
01/06/2022, 12:28 PM`Sebastlan
01/06/2022, 12:28 PMhttps://i.imgur.com/rv3zppS.png▾
ifox
01/06/2022, 12:29 PM`Sebastlan
01/06/2022, 12:31 PM`Sebastlan
01/06/2022, 12:31 PM`Sebastlan
01/06/2022, 12:32 PM`Sebastlan
01/06/2022, 12:32 PM