fix: use title-based slugs for new markers
All checks were successful
Deploy / Build and Deploy to Production (push) Successful in 20s

Generate marker slugs from title (e.g., "marqueur-2") instead of
timestamp-based slugs (e.g., "marker-1770362950"). Also fix panelUrl
generation to use Kirby's panel URL method.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
isUnknown 2026-02-06 08:47:28 +01:00
parent 575534d182
commit 8e67431622
2 changed files with 79 additions and 28 deletions

View file

@ -166,9 +166,9 @@ return [
->filterBy('intendedTemplate', 'marker');
$nextNum = $existingMarkers->count() + 1;
// Generate unique slug and title
$slug = 'marker-' . time();
// Generate title and slug based on title
$title = 'Marqueur ' . $nextNum;
$slug = Str::slug($title);
// Create the new marker page
$newMarker = $mapPage->createChild([
@ -307,7 +307,7 @@ return [
'lon' => $lon
],
'num' => $marker->num(),
'panelUrl' => '/panel/pages/' . $marker->id(),
'panelUrl' => (string) $marker->panel()->url(),
'iconUrl' => $iconUrl,
'iconSize' => $iconSize
]