mirror of
https://github.com/silverstripe/silverstripe-widgets
synced 2024-10-22 15:05:54 +00:00
Merge pull request #66 from tractorcow/inherit-sidebar-fix
BUG Fixed issue with nested InheritSideBar not inheriting beyond the first level
This commit is contained in:
commit
b28a6b27d6
@ -39,10 +39,10 @@ class WidgetPageExtension extends DataExtension {
|
||||
public function SideBarView() {
|
||||
if(
|
||||
$this->owner->InheritSideBar
|
||||
&& $this->owner->getParent()
|
||||
&& $this->owner->getParent()->hasMethod('SideBar')
|
||||
&& ($parent = $this->owner->getParent())
|
||||
&& $parent->hasMethod('SideBarView')
|
||||
) {
|
||||
return $this->owner->getParent()->SideBar();
|
||||
return $parent->SideBarView();
|
||||
} elseif($this->owner->SideBar()->exists()){
|
||||
return $this->owner->SideBar();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user