{{ $section['heading'] }}
@endif @if(!empty($section['text'])){!! nl2br(e($section['text'])) !!}
@endif@extends('frontend.main_master') @section('content') @php $layoutConfig = is_array($page->layout_config ?? null) ? $page->layout_config : null; $builderHero = is_array($layoutConfig['hero'] ?? null) ? $layoutConfig['hero'] : []; $builderSections = is_array($layoutConfig['sections'] ?? null) ? $layoutConfig['sections'] : []; $hasElementsSection = false; $hasZodiacSection = false; foreach ($builderSections as $builderSection) { if (($builderSection['type'] ?? null) === 'elements') { $hasElementsSection = true; } if (($builderSection['type'] ?? null) === 'zodiac') { $hasZodiacSection = true; } } $useBirthChartVisuals = in_array((string) ($page->template_key ?? ''), ['birth_chart_article', 'birth_chart_guide'], true) || $hasElementsSection || $hasZodiacSection; $heroTitle = trim((string) ($builderHero['title'] ?? '')) !== '' ? $builderHero['title'] : ($page->title ?? 'Sayfa'); $heroSubtitle = trim((string) ($builderHero['subtitle'] ?? '')) !== '' ? $builderHero['subtitle'] : ($page->subtitle ?? null); $sanitizeHex = static function ($value, $default) { $value = trim((string) $value); return preg_match('/^#[0-9a-fA-F]{6}$/', $value) ? strtolower($value) : $default; }; $heroTitleColor = $sanitizeHex($builderHero['title_color'] ?? '#ffffff', '#ffffff'); $heroSubtitleColor = $sanitizeHex($builderHero['subtitle_color'] ?? '#ffffff', '#ffffff'); $heroButtons = []; if (is_array($builderHero['buttons'] ?? null)) { foreach ($builderHero['buttons'] as $button) { if (!is_array($button)) { continue; } $text = trim((string) ($button['text'] ?? '')); $url = trim((string) ($button['url'] ?? '')); if ($text === '' || $url === '') { continue; } $heroButtons[] = [ 'text' => $text, 'url' => $url, 'bg_color' => $sanitizeHex($button['bg_color'] ?? '#ffffff', '#ffffff'), 'text_color' => $sanitizeHex($button['text_color'] ?? '#1f2937', '#1f2937'), ]; } } // Geriye dönük uyumluluk: eski tek buton alanını yeni listeye çevir. if (empty($heroButtons)) { $legacyButtonText = trim((string) ($builderHero['button_text'] ?? '')); $legacyButtonUrl = trim((string) ($builderHero['button_url'] ?? '')); if ($legacyButtonText !== '' && $legacyButtonUrl !== '') { $heroButtons[] = [ 'text' => $legacyButtonText, 'url' => $legacyButtonUrl, 'bg_color' => '#ffffff', 'text_color' => '#1f2937', ]; } } $heroBackgroundType = $builderHero['background_type'] ?? 'image'; $heroBackgroundColor = $builderHero['background_color'] ?? '#1f2937'; $heroGradientFrom = $builderHero['gradient_from'] ?? '#1f2937'; $heroGradientTo = $builderHero['gradient_to'] ?? '#7c3aed'; if ($heroBackgroundType === 'solid') { $heroStyle = 'background: ' . $heroBackgroundColor . ';'; } elseif ($heroBackgroundType === 'gradient') { $heroStyle = 'background: linear-gradient(135deg, ' . $heroGradientFrom . ', ' . $heroGradientTo . ');'; } else { $heroImagePath = $page->hero_image ? asset($page->hero_image) : asset('frontend/images/default-hero.jpg'); $heroStyle = 'background-image: url(' . $heroImagePath . ');'; } @endphp @push('styles') @if($useBirthChartVisuals) @endif @endpush
{{ $heroSubtitle }}
@endif @if(!empty($heroButtons)) @endif{!! nl2br(e($section['text'])) !!}
@endif