diff --git a/src/Tags/Structure.php b/src/Tags/Structure.php index a3a132dc9f..fb29c72066 100644 --- a/src/Tags/Structure.php +++ b/src/Tags/Structure.php @@ -136,7 +136,6 @@ public function toArray($tree, $parent = null, $depth = 1) return array_merge($data, [ 'children' => $children, - 'parent' => $parent, 'depth' => $depth, 'index' => $index, 'count' => $index + 1, @@ -145,7 +144,7 @@ public function toArray($tree, $parent = null, $depth = 1) 'is_current' => ! is_null($url) && rtrim($url, '/') === rtrim($this->currentUrl, '/'), 'is_parent' => ! is_null($url) && $this->siteAbsoluteUrl !== $absoluteUrl && URL::isAncestorOf($this->currentUrl, $url), 'is_external' => URL::isExternal((string) $absoluteUrl), - ]); + ], $this->params->bool('include_parents', true) ? ['parent' => $parent] : []); })->filter()->values(); $this->updateIsParent($pages);