Skip to content

Commit

Permalink
Fix pages navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
giuscris committed Oct 14, 2024
1 parent 72b0e13 commit ab50961
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions formwork/src/Panel/Controllers/PagesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -918,12 +918,12 @@ protected function getPreviousAndNextPage(Page $page): array
{
$inclusiveSiblings = $page->inclusiveSiblings();

$indexOffset = $inclusiveSiblings->indexOf($this->site()->indexPage());

if ($page->parent()?->scheme()->options()->get('children.reverse')) {
$inclusiveSiblings = $inclusiveSiblings->reverse();
}

$indexOffset = $inclusiveSiblings->indexOf($this->site()->indexPage());

if ($indexOffset !== null) {
$inclusiveSiblings->moveItem($indexOffset, 0);
}
Expand Down

0 comments on commit ab50961

Please sign in to comment.