v0.9.2
This commit is contained in:
commit
8f8513f802
278 files changed
+18400
No files matched your search
@@ -0,0 +1,23 @@
|
||||
@php
|
||||
// What a record shows is found under the usual names: title or name, summary / story / quote / role, photo, url.
|
||||
$pick = fn (array $item, array $keys) => collect($keys)->map(fn ($key) => $item[$key] ?? null)->first(fn ($value) => is_string($value) && $value !== '');
|
||||
@endphp
|
||||
<section class="mb-block mb-cards {{ $classes }}">
|
||||
<div class="mb-inner">
|
||||
@if (($data['eyebrow'] ?? '') !== '')<p class="mb-eyebrow">{{ $data['eyebrow'] }}</p>@endif
|
||||
@if (($data['title'] ?? '') !== '')<h2>{{ $data['title'] }}</h2>@endif
|
||||
<div class="mb-grid">
|
||||
@foreach ($items as $item)
|
||||
@php($url = $pick($item, ['url', 'link']))
|
||||
<article class="mb-card">
|
||||
@if ($photo = $pick($item, ['photo', 'picture', 'image']))<img src="{{ \IriksIT\Manager\Support\Blocks::safeUrl($photo) }}" alt="" loading="lazy">@endif
|
||||
<h3>@if ($url)<a href="{{ \IriksIT\Manager\Support\Blocks::safeUrl($url) }}">{{ $pick($item, ['title', 'name', 'label']) }}</a>@else{{ $pick($item, ['title', 'name', 'label']) }}@endif</h3>
|
||||
@if ($text = $pick($item, ['summary', 'story', 'quote', 'intro', 'role']))<p>{{ $text }}</p>@endif
|
||||
</article>
|
||||
@endforeach
|
||||
</div>
|
||||
@if (($data['button_label'] ?? '') !== '')
|
||||
@include('manager::blocks.partials.buttons', ['buttons' => [['label' => $data['button_label'], 'url' => $data['button_url'] ?? '', 'style' => 'secondary']]])
|
||||
@endif
|
||||
</div>
|
||||
</section>
|
||||
Reference in new issue
Block a user