v1.1.2 candidate: Maps link in main menu via navigation event

This commit is contained in:
mowet601 committed 2026-11-26 12:58:22 -05:00
1 parent e4735f9546
commit ca32ea7543
1 file changed
+22
@@ -124,6 +124,28 @@ class MapListing extends Extension
];
});
// "Maps" in the storefront main menu (DESIGN.md §15): the
// sleek theme's <x-navigation /> renders
// Navigation::getLinks(), which runs
// EventHelper::itemEvent('navigation', $routes) — a listener
// return is appended to the menu and sorted by `priority`
// (Home and Shop carry none, i.e. 0, so 10 puts Maps after
// them). The `route` key is resolved to the URL by
// Navigation::markActiveRoute(), which also appends
// `-line`/`-fill` to the icon (ri-map-pin-line /
// ri-map-pin-fill both exist in Remix Icon). The maps page
// is public, so the link shows for guests and signed-in
// users alike. boot() only runs while the extension is
// enabled, so disabling the extension removes the link.
Event::listen('navigation', function () {
return [
'name' => 'Maps',
'route' => 'maplistings.index',
'icon' => 'ri-map-pin',
'priority' => 10,
];
});
// A deleted product must not leave a dead pin behind: unpublish
// its approved listings from the map first. The rows themselves
// are removed by the product delete (no FK on subject_id — the