Add show_in_nav option for categories in top menu
Deploy to Production (witstore.wende.it) / deploy (push) Successful in 6s
Deploy to Production (witstore.wende.it) / deploy (push) Successful in 6s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -43,6 +43,10 @@
|
||||
<input type="checkbox" name="active" id="active" value="1" {{ old('active', $category->active ?? true) ? 'checked' : '' }}>
|
||||
<label for="active" class="text-sm">Aktiv</label>
|
||||
</div>
|
||||
<div class="flex items-end gap-2 pb-2">
|
||||
<input type="checkbox" name="show_in_nav" id="show_in_nav" value="1" {{ old('show_in_nav', $category->show_in_nav ?? false) ? 'checked' : '' }}>
|
||||
<label for="show_in_nav" class="text-sm">Im Top-Menü anzeigen</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex gap-3 pt-2">
|
||||
|
||||
@@ -33,6 +33,11 @@
|
||||
->orderBy('nav_sort')
|
||||
->orderBy('title')
|
||||
->get();
|
||||
$navCategories = \App\Models\Category::whereNull('parent_id')
|
||||
->where('active', true)
|
||||
->where('show_in_nav', true)
|
||||
->orderBy('sort_order')
|
||||
->get();
|
||||
@endphp
|
||||
|
||||
{{-- Header: Logo-Leiste --}}
|
||||
@@ -57,6 +62,13 @@
|
||||
class="px-3 py-2 rounded-lg text-sm font-medium text-gray-700 hover:bg-blue-50 hover:text-blue-700 transition">
|
||||
Alle Produkte
|
||||
</a>
|
||||
@foreach($navCategories as $navCat)
|
||||
<a href="{{ route('shop.category', $navCat->slug) }}"
|
||||
class="px-3 py-2 rounded-lg text-sm font-medium text-gray-700 hover:bg-blue-50 hover:text-blue-700 transition
|
||||
{{ request()->route('slug') === $navCat->slug ? 'bg-blue-50 text-blue-700' : '' }}">
|
||||
{{ $navCat->name }}
|
||||
</a>
|
||||
@endforeach
|
||||
@foreach($navPages as $navPage)
|
||||
<a href="{{ route('page', $navPage->slug) }}"
|
||||
class="px-3 py-2 rounded-lg text-sm font-medium text-gray-700 hover:bg-blue-50 hover:text-blue-700 transition
|
||||
|
||||
Reference in New Issue
Block a user