forTemplateShort

This commit is contained in:
Tony Air 2022-07-04 17:16:17 +02:00
parent f38d186a09
commit c7463ebfd9

View File

@ -30,4 +30,12 @@ class BlogPostExtension extends DataExtension
$mainTab = $fields->findOrMakeTab('Root.Main');
$mainTab->push(CheckboxField::create('Featured'));
}
public function forTemplateShort()
{
return $this->owner->renderWith([
$this->owner->ClassName.'_short',
'SilverStripe\Blog\Includes\BlogPostInfo'
]);
}
}