{{-- resources/views/public/page.blade.php --}} {{ $page->title }} - {{ $website->name }} {{-- Your other meta tags, CSS links, etc. --}} @php // Fetch the global sections and the main menu $headerSection = $website->globalSections()->where('type', 'header')->where('is_default', true)->first(); $footerSection = $website->globalSections()->where('type', 'footer')->where('is_default', true)->first(); $mainMenu = $website->menus()->where('location', 'main')->first() ?? $website->menus()->first(); @endphp {{-- Dynamic CSS from the Database --}} @if($isPreview)
PREVIEW MODE - This is how your page will look to visitors
@endif @if($headerSection) {!! $headerSection->getRenderedContent() !!} @endif @if($mainMenu && $mainMenu->items->count() > 0) @endif
{{-- DEBUG: Rendering with getRenderedContent() --}} {!! $page->getRenderedContent() !!}
@if($footerSection) {!! $footerSection->getRenderedContent() !!} @endif {{-- Your script tags --}}