fix: use title-based slugs for new markers
All checks were successful
Deploy / Build and Deploy to Production (push) Successful in 20s
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:
parent
575534d182
commit
8e67431622
2 changed files with 79 additions and 28 deletions
|
|
@ -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
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue