@props(['section', 'activeTheme']) @if($section && isset($section->type) && isset($section->content)) @php $sectionLayout = $section->layout ?? 'default'; // Path for layout specific to section type: themes.theme_name.sections.layouts.SECTION_TYPE.LAYOUT_NAME.blade.php $specificLayoutPath = "landingpage::themes.{$activeTheme}.sections.layouts.{$section->type}.{$sectionLayout}"; // Path for generic layout: themes.theme_name.sections.layouts.LAYOUT_NAME.blade.php $genericLayoutPath = "landingpage::themes.{$activeTheme}.sections.layouts.{$sectionLayout}"; // Path for a very basic default layout: themes.theme_name.sections.layouts.default.blade.php $defaultLayoutPath = "landingpage::themes.{$activeTheme}.sections.layouts.default"; // Data to pass to the included view $viewData = [ 'section' => $section, 'title' => $section->title, // Section's own title, if any (distinct from content.title) 'content' => $section->content, // The JSON content array 'activeTheme' => $activeTheme, // Pass active theme for any nested components/logic ]; @endphp @if (view()->exists($specificLayoutPath)) @include($specificLayoutPath, $viewData) @elseif (view()->exists($genericLayoutPath)) @include($genericLayoutPath, $viewData) @elseif (view()->exists($defaultLayoutPath)) @include($defaultLayoutPath, $viewData) @else

Section Layout Missing!

Layout partial for section type "{{ $section->type }}" with layout "{{ $sectionLayout }}" not found in theme "{{ $activeTheme }}".

Attempted paths (most specific first):

@if(config('app.debug') && isset($section->content))
Content Data:
{{ json_encode($section->content, JSON_PRETTY_PRINT) }}
@endif
@endif @else @endif