Skip to content

Commit

Permalink
fix: breadcrumbMeta items order logic
Browse files Browse the repository at this point in the history
  • Loading branch information
johannschopplich committed May 2, 2024
1 parent 69237fa commit 5bf2f9e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/extensions/pageMethods.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
'breadcrumbMeta' => function (): array {
/** @var \Kirby\Cms\Page $this */
$breadcrumb = [];
$breadcrumb[] = [
'title' => $this->title()->value(),
'uri' => $this->uri()
];
$parent = $this->parent();

while ($parent) {
Expand All @@ -35,11 +39,6 @@
$parent = $parent->parent();
}

$breadcrumb[] = [
'title' => $this->title()->value(),
'uri' => $this->uri()
];

return array_reverse($breadcrumb);
},

Expand Down

0 comments on commit 5bf2f9e

Please sign in to comment.