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() public function ShowSidebar()
{ {
$obj = $this->owner; $obj = $this->owner;
if($obj->DisableSidebar) {
return false;
}
$area = $obj->ElementalArea(); $area = $obj->ElementalArea();
if (!$area) { if (!$area) {
return true; return true;

View File

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