Skip to content

Commit 75c4280

Browse files
authored
Merge branch '3.x' into fix/slug-encoding
2 parents f266288 + 1b115e6 commit 75c4280

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

docs/content/1_docs/4_form-fields/11_repeater.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,32 @@ class ProjectController extends BaseModuleController
161161
]);
162162
}
163163
}
164+
```
165+
### Medias
166+
167+
If your json repeater contains media formField, you need to define the
168+
`mediasParams` at `config/twill.php` under `repeaters.crops` or `block_editor.crops`.
169+
170+
```
171+
'repeaters' => [
172+
'crops' => [
173+
‘your-media-field-name’ => [
174+
175+
]
176+
],
177+
]
178+
```
179+
180+
OR
181+
```
182+
'block_editor' => [
183+
'crops' => [
184+
‘your-media-field-name’ => [
185+
186+
]
187+
],
188+
]
189+
164190
```
165191

166192
| Option | Description | Type | Default value |

src/TwillBlocks.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,8 @@ public function readBlocksFromDirectory(
310310
public function getAllCropConfigs($prefixKey = false): array
311311
{
312312
if (! $this->cropConfigs) {
313-
$this->cropConfigs = config()->get('twill.block_editor.crops');
313+
$this->cropConfigs = config()->get('twill.block_editor.crops')
314+
+ (config()->get('twill.repeaters.crops') ?? []);
314315

315316
/** @var Block $block */
316317
foreach ($this->getBlockCollection() as $block) {

0 commit comments

Comments
 (0)