@props(['data' => null])
@foreach ($data['cards'] as $card) @php $linkData = $card['card_link_wrapper'] ?? null; $href = null; $linkTarget = null; $redirectType = $linkData['redirect']['type'] ?? null; $redirectValue = trim($linkData['redirect']['value'] ?? ''); if ($linkData && $redirectType && $redirectValue !== '') { // Internal values can be a catalogue reference ("slug:42"): slug_path() // turns it into the current path, and null when the content is gone — the // card then renders without a link. See docs/CLAUDE-SLUGS-CATALOGO.md. $internalPath = slug_path($redirectValue); $href = match ($redirectType) { 'url' => str_starts_with($redirectValue, 'http') ? $redirectValue : 'https://' . ltrim($redirectValue, '/'), 'internal' => $internalPath === null ? null : '/' . ltrim($internalPath, '/'), 'contact_link' => $redirectValue, default => $redirectValue, }; $linkTarget = $redirectType === 'url' ? '_blank' : null; } @endphp
@if ($href) @endif
@if (!empty($card['card_icon'])) {{ translate_label($card, 'title') }} @endif {{ translate_label($card, 'title') }} {{ translate_label($card, 'subtitle') }}
@if ($href)
@endif @if (!empty($card['body']))
{!! tiptap_converter()->asHTML(translate_data($card['body'])) !!}
@endif
@endforeach