structure changes

This commit is contained in:
Mark Gregory
2026-07-27 14:17:30 +01:00
parent bdb5e7825d
commit df5d6077cb
13 changed files with 468 additions and 277 deletions
@@ -1,43 +1,17 @@
@php
$footerContent = $footerContent ?? [];
$columns = collect($footerContent['columns'] ?? [])->filter(
fn (array $column): bool => filter_var($column['enabled'] ?? true, FILTER_VALIDATE_BOOL)
);
$navigation = app(\Modules\Stylist\Support\FrontendNavigation::class);
$columns = collect([
['heading' => $footerContent['explore_heading'] ?? 'Explore', 'items' => $navigation->location($footerContent['explore_menu_location'] ?? 'footer', $footerNavigation ?? [])],
['heading' => $footerContent['account_heading'] ?? 'Account', 'items' => $navigation->location($footerContent['account_menu_location'] ?? 'footer_account')],
['heading' => $footerContent['legal_heading'] ?? 'Legal', 'items' => $navigation->location($footerContent['legal_menu_location'] ?? 'footer_legal')],
])->filter(fn(array $column) => $column['items'] !== []);
$copyright = $siteSettings['copyright'] ?: ('© '.date('Y').' '.$siteSettings['company_name'].'. All rights reserved.');
@endphp
<style>
.footer.cms-editable-footer .footer-grid{display:grid;grid-template-columns:minmax(280px,1.5fr) repeat(3,minmax(160px,1fr));gap:3rem;padding-block:4rem 2rem;align-items:start;}
.cms-editable-footer .footer-brand{max-width:36rem}.cms-editable-footer .footer-brand p{max-width:34rem;line-height:1.7;}
.cms-editable-footer .footer-column h3{margin:0 0 1rem;font-size:1rem}.cms-editable-footer .footer-column ul{display:grid;gap:.75rem;list-style:none;margin:0;padding:0;}
.cms-editable-footer .footer-column a{display:inline-flex;text-decoration:none}.cms-editable-footer .copyright{padding-block:1.5rem 2rem;}
@media(max-width:900px){.footer.cms-editable-footer .footer-grid{grid-template-columns:1fr;gap:2rem;padding-block:3rem 1.5rem}}
</style>
<footer class="footer cms-editable-footer">
<div class="wrap footer-grid">
<div class="footer-brand">
<a class="logo" href="{{ $footerContent['brand_url'] ?? url('/') }}">{{ $footerContent['brand_text'] ?? $siteTitle }}</a>
@if (! empty($footerContent['description'] ?? $siteDescription))
<p>{{ $footerContent['description'] ?? $siteDescription }}</p>
@endif
</div>
@foreach ($columns as $column)
<div class="footer-column">
<h3>{{ $column['heading'] ?? 'Links' }}</h3>
<ul>
@foreach (collect($column['links'] ?? [])->filter(fn (array $link): bool => filter_var($link['enabled'] ?? true, FILTER_VALIDATE_BOOL)) as $link)
<li><a href="{{ $link['url'] ?? '#' }}">{{ $link['label'] ?? 'Link' }}</a></li>
@endforeach
</ul>
</div>
@endforeach
</div>
<div class="wrap copyright">
<span>{{ $footerContent['copyright'] ?? ('© '.date('Y').' '.$siteTitle.'. All rights reserved.') }}</span>
@if (filter_var($footerContent['show_back_to_top'] ?? true, FILTER_VALIDATE_BOOL))
<a href="#top">{{ $footerContent['back_to_top_label'] ?? 'Back to top ↑' }}</a>
@endif
<div class="footer-brand"><a class="logo" href="{{ $siteSettings['site_url'] ?: url('/') }}">{{ $siteTitle }}</a><p>{{ $siteDescription }}</p>@if($siteSettings['contact_email'])<a href="mailto:{{ $siteSettings['contact_email'] }}">{{ $siteSettings['contact_email'] }}</a>@endif</div>
@foreach($columns as $column)<div class="footer-column"><h3>{{ $column['heading'] }}</h3><ul>@foreach($column['items'] as $link)<li><a href="{{ $link['url'] }}" @if($link['target']) target="{{ $link['target'] }}" rel="noopener" @endif>{{ $link['label'] }}</a></li>@endforeach</ul></div>@endforeach
</div>
<div class="wrap copyright"><span>{{ $copyright }}</span>@if(filter_var($footerContent['show_back_to_top'] ?? true,FILTER_VALIDATE_BOOL))<a href="#top">{{ $footerContent['back_to_top_label'] ?? 'Back to top ↑' }}</a>@endif</div>
</footer>