@php /** * 2-column accordion+image layout. * * Base render mirrors home-jewelry.html "Banner Collection" (lines 2395-2495): * left column accordion list, right column shows the active collection image. * * home-fashion-2.html §5 "Collection style" (lines 3954-4066) is the same * structure with cosmetic modifiers — opt in via knobs: * container_class — wrapper container (default `container-full`; fashion-2 `container`) * card_modifier — extra classes on `.banner-collect-v01` (fashion-2 `style-2 st-2_2`) * accordion_modifier — extra classes on `.list-btn-tab-accordion` (fashion-2 `style-2`) * title_class — accordion item title span class (default `h4 fw-medium`; fashion-2 `h5 fw-medium`) * button_text/url — optional CTA button below the accordion (fashion-2 "Shop Collections") * image_size — RvMedia size for the right-column image (default `hero-banner`; * fashion-2 demo art is 705x705 square → pass `original`) * expanded_index — 0-based numeric index of the tab/accordion to open by * default. Default `0` (first item). Set to a different * index to expand a different collection on load. * Allowlist: integers in [0, count(collections) - 1]. * * First item starts open. Falls back to a flat list when only one collection is supplied. */ $collections = collect($collections)->values(); $domId = 'bnClsV01-' . substr(md5((string) ($shortcode->id ?? uniqid())), 0, 6); $containerClass = trim((string) ($shortcode->container_class ?? '')) ?: 'container-full'; $cardModifier = trim((string) ($shortcode->card_modifier ?? '')); $accordionModifier = trim((string) ($shortcode->accordion_modifier ?? '')); $titleClass = trim((string) ($shortcode->title_class ?? '')) ?: 'h4 fw-medium'; $buttonText = trim((string) ($shortcode->button_text ?? '')); $buttonUrl = trim((string) ($shortcode->button_url ?? '')) ?: '#'; $imageSize = trim((string) ($shortcode->image_size ?? '')) ?: 'hero-banner'; $imageSize = $imageSize === 'original' ? false : $imageSize; // expanded_index: which tab is open on first render. Default 0 (first item). // Validate against the collections count to avoid no-tab-open edge cases. $expandedRaw = $shortcode->expanded_index ?? null; $expandedIndex = is_numeric($expandedRaw) ? (int) $expandedRaw : 0; if ($expandedIndex < 0 || $expandedIndex >= $collections->count()) { $expandedIndex = 0; } @endphp