ifox
12/05/2022, 1:51 PMelkex
12/05/2022, 1:52 PMifox
12/05/2022, 1:53 PM$downloads
elkex
12/05/2022, 1:55 PMifox
12/05/2022, 1:56 PMifox
12/05/2022, 1:56 PMelkex
12/05/2022, 1:56 PM<?php
namespace App\Twill\Block;
use A17\Twill\Models\File;
use A17\Twill\Services\Blocks\Block;
class RecentDownloads extends Block
{
public function getData(array $data, \A17\Twill\Models\Block $block): array
{
$data = parent::getData($data, $block);
$data['downloads'][] = File::latest()->take(6)->get();
return $data;
}
}
ifox
12/05/2022, 1:57 PMrecent-downloads
?elkex
12/05/2022, 1:58 PMifox
12/05/2022, 1:58 PMelkex
12/05/2022, 1:59 PMelkex
12/05/2022, 2:01 PMifox
12/05/2022, 2:03 PMrenderBlocks
?elkex
12/05/2022, 2:04 PM{!! $page->renderBlocks() !!}
ifox
12/05/2022, 2:12 PMrecent_downloads
a repeater inside another block, or is it the block itself?ifox
12/05/2022, 2:13 PMrecent_downloads.blade.php
, this should work. If not, we'll investigateelkex
12/05/2022, 2:13 PMelkex
12/05/2022, 2:14 PMifox
12/05/2022, 2:17 PMifox
12/05/2022, 2:18 PMifox
12/05/2022, 2:19 PMelkex
12/05/2022, 2:29 PMifox
12/05/2022, 2:32 PMifox
12/05/2022, 2:32 PMelkex
12/05/2022, 2:52 PM@formField('block_editor', [
'label' => 'Page content',
'blocks' => [ 'recent_downloads']
])
DKC
12/06/2022, 7:31 AMphp
@if ($permalink ?? true)
<x-twill::input
name="slug"
:label="twillTrans('twill::lang.modal.permalink-field')"
:translated="true"
ref="permalink"
:prefix="$permalinkPrefix ?? ''"
/>
@endif
I tried to change :translated to false, but will have buggy result.Hip-Hop
12/06/2022, 9:04 AMelkex
12/06/2022, 9:42 AMkalle
12/06/2022, 10:00 AMelkex
12/06/2022, 10:09 AM