What happened is that pages added by plugins in the admin get counted
as normal site pages. Counting only routable and modular pages solves
the issue without messing with iterating over page types added by
plugins
This commit is contained in:
Flavio Copes
2015-10-02 11:47:26 +02:00
parent d2daa17352
commit 772074cd97
2 changed files with 14 additions and 1 deletions

View File

@@ -384,6 +384,19 @@ class Admin
}
return $routes;
}
/**
* Count the pages
*
* @return array
*/
public function countPages()
{
$routable = $this->grav['pages']->all()->routable();
$modular = $this->grav['pages']->all()->modular();
return count($routable) + count($modular);
}
/**
* Get All template types