From d01374dddb00568a4ff095470f5e5954f9b214c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ste=CC=81phane=20Goetz?= Date: Mon, 27 Apr 2015 16:47:14 +0200 Subject: [PATCH] Fix first page calculation --- libs/Tree/Entry.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libs/Tree/Entry.php b/libs/Tree/Entry.php index d0767ad..32575ee 100644 --- a/libs/Tree/Entry.php +++ b/libs/Tree/Entry.php @@ -72,7 +72,12 @@ abstract class Entry if ($this instanceof Directory) { foreach ($this->value as $node) { - if ($node instanceof Content && $node->title != 'index') { + if ($node instanceof Content) { + if (!count($node->getParents()) && $node->title == 'index') { + //the homepage should not count as first page + continue; + } + $this->first_page = $node; return $node; }