Cleaned getFirstPage a bit
This commit is contained in:
parent
87fbb6f15d
commit
d531de86cf
@ -66,16 +66,11 @@ class Directory extends Entry
|
|||||||
return $this->first_page;
|
return $this->first_page;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$this instanceof Directory) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// First we try to find a real page
|
// First we try to find a real page
|
||||||
foreach ($this->getEntries() as $node) {
|
foreach ($this->getEntries() as $node) {
|
||||||
if ($node instanceof Content) {
|
if ($node instanceof Content) {
|
||||||
// TODO :: this condition looks weird ...
|
if ($this instanceof Root && $this->getIndexPage() == $node) {
|
||||||
if (!$node->getParent() && $node->getTitle() == 'index') {
|
// The homepage should not count as first page
|
||||||
//the homepage should not count as first page
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user