IMPR: Allow to disable sidebar

This commit is contained in:
Tony Air 2024-06-28 20:32:14 +02:00
parent 03dba051bc
commit 671298a590
2 changed files with 6 additions and 1 deletions

View File

@ -49,6 +49,11 @@ class SiteTreeExtension extends DataExtension
public function ShowSidebar()
{
$obj = $this->owner;
if($obj->DisableSidebar) {
return false;
}
$area = $obj->ElementalArea();
if (!$area) {
return true;

View File

@ -7,7 +7,7 @@
</div>
<% end_if %>
<% if not $DisableSidebar && $SideBarContent || $SideBarView && $SideBarView.Widgets.Count %>
<% if $ShowSidebar %>
<div class="content-holder content-holder__sidebar">
<div class="{$DefaultContainer}">
<div class="row">