Breadcrumbs: always start at Home, full category trail, BreadcrumbList JSON-LD
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9d7f92ebfc
commit
fb239a97cb
8 files changed
+114
-18
No files matched your search
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Catalog\CollectionTrail;
|
||||
use App\Catalog\ProductListing;
|
||||
use App\Catalog\ProductListingPage;
|
||||
use Illuminate\Http\Response;
|
||||
@@ -12,6 +13,7 @@ class CategoryController extends Controller
|
||||
public function __construct(
|
||||
private readonly ProductListingPage $listingPage,
|
||||
private readonly CollectionService $collections,
|
||||
private readonly CollectionTrail $trail,
|
||||
) {}
|
||||
|
||||
public function show(string $locale, int $collection)
|
||||
@@ -27,6 +29,10 @@ public function show(string $locale, int $collection)
|
||||
$collectionData['id'],
|
||||
);
|
||||
|
||||
return view('category.show', [...$data, 'collection' => $collectionData]);
|
||||
return view('category.show', [
|
||||
...$data,
|
||||
'collection' => $collectionData,
|
||||
'breadcrumb' => $this->trail->for($collectionData, linkLast: false),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user