Handle sub pages of 'home' menu item better

This commit is contained in:
Andy Miller
2014-11-09 12:52:23 -07:00
parent 2fac370741
commit 2c247a4529

View File

@@ -1349,10 +1349,21 @@ class Page
{
/** @var Uri $uri */
$uri = self::$grav['uri'];
$config = self::$grav['config'];
if (!$this->home() && (strpos($uri->url(), $this->url()) === 0)) {
return true;
// Special check when item is home
if ($this->home()) {
$paths = $uri->paths();
$home = ltrim($config->get('system.home.alias'), '/');
if ($paths[0] == $home) {
return true;
}
} else {
if (strpos($uri->url(), $this->url()) === 0) {
return true;
}
}
return false;
}