mirror of
https://github.com/a2nt/cms-niceties.git
synced 2024-10-22 11:05:46 +02:00
FIX: Sidebar
This commit is contained in:
parent
f77f7acd55
commit
bc48151da8
@ -50,7 +50,7 @@ class SiteTreeExtension extends DataExtension
|
|||||||
{
|
{
|
||||||
$obj = $this->owner;
|
$obj = $this->owner;
|
||||||
|
|
||||||
if($obj->DisableSidebar) {
|
if ($obj->DisableSidebar) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,19 +58,16 @@ class SiteTreeExtension extends DataExtension
|
|||||||
if (!$area) {
|
if (!$area) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$els = $area->Elements();
|
$els = $area->Elements();
|
||||||
if (!$els) {
|
if (!$els) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
$els = $els->find('ClassName', SidebarElement::class);
|
$sidebarEl = $els->find('ClassName', SidebarElement::class)?->first();
|
||||||
if (!$els) {
|
if ($sidebarEl) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($els->first()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($obj->SideBarContent) {
|
if ($obj->SideBarContent) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -108,7 +105,7 @@ class SiteTreeExtension extends DataExtension
|
|||||||
return $this->_cached['summary' . $wordsToDisplay];
|
return $this->_cached['summary' . $wordsToDisplay];
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!method_exists($obj, 'ElementalArea')) {
|
if (!method_exists($obj, 'ElementalArea')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user