@php use Botble\Base\Facades\BaseHelper; use Botble\Media\Facades\RvMedia; /** * 4-tab Banner Product (home-furniture §4 pattern). * Mirrors html/home-furniture.html lines 2166-2249 — `flat-animate-tab-2 banner-collect-v02`: * *
* *
* * Bootstrap's data-bs-toggle="tab" handles the JS — no custom script needed. * Tab IDs are auto-generated `bcv02-tab-N-{uniqid}` to avoid collisions if the * shortcode appears multiple times on a page. * * Attrs (all optional): * tab_1_label..tab_4_label — h3 nav labels (default: empty tab skipped) * tab_1_image..tab_4_image — content pane image (defaults to tab_1_image fallback) * thumb_1..thumb_3 — bottom thumbs strip (transparent PNG works best) * description — bottom shared paragraph * button_text, button_url — bottom shared CTA */ $uid = uniqid('bcv02-tab-'); $tabs = []; for ($i = 1; $i <= 4; $i++) { $label = trim((string) ($shortcode->{'tab_' . $i . '_label'} ?? '')); $image = trim((string) ($shortcode->{'tab_' . $i . '_image'} ?? '')); if ($label === '' && $image === '') { continue; } $tabs[] = [ 'id' => $uid . '-' . $i, 'label' => $label !== '' ? $label : __('Tab :n', ['n' => $i]), 'image' => $image, ]; } // Fallback: every tab gets the same image if only tab_1_image is supplied. $fallbackImage = $tabs[0]['image'] ?? ''; foreach ($tabs as &$tab) { if ($tab['image'] === '' && $fallbackImage !== '') { $tab['image'] = $fallbackImage; } } unset($tab); $thumbs = array_filter([ trim((string) ($shortcode->thumb_1 ?? '')), trim((string) ($shortcode->thumb_2 ?? '')), trim((string) ($shortcode->thumb_3 ?? '')), ]); $description = trim((string) ($shortcode->description ?? '')); $buttonText = trim((string) ($shortcode->button_text ?? __('Shop Collection'))); $buttonUrl = trim((string) ($shortcode->button_url ?? '#')); @endphp @if (! empty($tabs))
@endif