Fix first page calculation

This commit is contained in:
Stéphane Goetz 2015-04-27 16:47:14 +02:00 committed by Stéphane Goetz
parent 3e374c7585
commit d01374dddb
1 changed files with 6 additions and 1 deletions

View File

@ -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;
}