@php $icons = is_array($section['parameters']['items'] ?? null) ? $section['parameters']['items'] : []; $backgroundColor = $section['parameters']['background_color'] ?? '#f8f9fa'; $textColor = $section['parameters']['text_color'] ?? 'dark'; $isCarousel = !empty($section['parameters']['is_carousel']); $textClass = ($textColor == 'light') ? 'text-white' : 'text-dark'; $count = count($icons); $colClass = 'col-md-4'; if ($count == 1) $colClass = 'col-md-12'; elseif ($count == 2) $colClass = 'col-md-6'; elseif ($count == 4) $colClass = 'col-md-3'; $renderText = function($text) { if (is_string($text) && (strpos($text, '{"type"') === 0 || strpos($text, '{"content"') === 0)) { return app(\V2\Services\ContentRichEditor\Services\ContentRichEditorRendererService::class)->toHtml($text); } return $text; }; @endphp @foreach($icons as $icon) @php $link = $icon['link'] ?? null; $hasLink = !empty($link); if ($hasLink && !preg_match('/^https?:\/\//i', $link) && strpos($link, '/') !== 0) { $link = '/' . $link; } @endphp @if($hasLink) @endif {{ $icon['title'] ?? '' }} {!! $renderText($icon['text'] ?? '') !!} @if($hasLink) @endif @endforeach @if($isCarousel) @section('other-scripts') @append @endif