This commit is contained in:
James Cocker 2022-08-10 05:30:29 +12:00 committed by GitHub
commit 62def43ae4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -312,6 +312,11 @@ class BlogPost extends Page
); );
} }
$shouldLazyLoadCategories = true;
if($this->Categories()->count() < 15) {
$shouldLazyLoadCategories = false;
}
// Get categories and tags // Get categories and tags
// @todo: Reimplement the sidebar // @todo: Reimplement the sidebar
// $options = BlogAdminSidebar::create( // $options = BlogAdminSidebar::create(
@ -326,7 +331,7 @@ class BlogPost extends Page
$this->Categories() $this->Categories()
) )
->setCanCreate($this->canCreateCategories()) ->setCanCreate($this->canCreateCategories())
->setShouldLazyLoad(true), ->setShouldLazyLoad($shouldLazyLoadCategories),
TagField::create( TagField::create(
'Tags', 'Tags',
_t(__CLASS__ . '.Tags', 'Tags'), _t(__CLASS__ . '.Tags', 'Tags'),