@extends('layouts.site', ['headerTemplate' => 'Demo27 Header']) @php use Illuminate\Support\Facades\Storage; @endphp @section('title', $product->translate('title') ?? 'Ürün Detayı') @section('meta_description', Str::limit(strip_tags($product->translate('content')), 160)) @php $landingData = $product->landing_page_data ?? []; $hero = $landingData['hero'] ?? []; // Fallback if hero data is empty if (empty($hero['slogan']) && empty($hero['sub_slogan']) && empty($hero['featured_image'])) { $hero['slogan'] = $product->translate('title'); $hero['sub_slogan'] = Str::limit(strip_tags($product->translate('content')), 160); $hero['featured_image'] = $product->hero_image; } $currentLang = app()->getLocale(); // Helper function to get translated value with fallback $getTranslated = function($item, $key, $default = '') use ($currentLang) { if (isset($item["{$key}_{$currentLang}"])) { return $item["{$key}_{$currentLang}"]; } return $item[$key] ?? $default; }; @endphp @section('content') {{-- Hero Section --}} @if(!empty($hero))
@if($slogan = $getTranslated($hero, 'slogan'))

{!! nl2br(e($slogan)) !!}

@endif @if($subSlogan = $getTranslated($hero, 'sub_slogan'))

{{ $subSlogan }}

@endif
@if(!empty($hero['app_store_link'])) App Store @endif @if(!empty($hero['google_play_link'])) Google Play @endif
@if(!empty($hero['featured_image']))
{{ $product->translate('title') }}
@endif
@endif @endsection