Add start to breadcrumb

This commit is contained in:
philipp lang 2025-07-26 00:57:20 +02:00
parent 3120ea4692
commit f044aab67c
1 changed files with 3 additions and 2 deletions

View File

@ -43,11 +43,12 @@ abstract class EventManager extends ComponentBase
private function getBreadcrumbs(): Collection
{
$breadcrumbs = collect([]);
$breadcrumbs->push(['url' => '/', 'title' => 'Start', 'isActive' => false]);
$breadcrumbs->push(['url' => $this->settings['indexUrl'], 'title' => 'Veranstaltungen', 'isActive' => $this->event === null]);
if ($this->event) {
$breadcrumbs->push([
'url' => (string) str($this->settings['singleUrl'])->replace(':slug', $this->event['slug']),
'url' => str($this->settings['singleUrl'])->replace(':slug', $this->event['slug'])->toString(),
'title' => $this->event['name'],
'isActive' => !$this->isRegistering()
]);
@ -55,7 +56,7 @@ abstract class EventManager extends ComponentBase
if ($this->event && $this->isRegistering()) {
$breadcrumbs->push([
'url' => (string) str($this->settings['registerUrl'])->replace(':slug', $this->event['slug']),
'url' => str($this->settings['registerUrl'])->replace(':slug', $this->event['slug'])->toString(),
'title' => 'Anmeldung',
'isActive' => true,
]);