From 5d2f0570d88742dca00f06d57a82849cde7f0d77 Mon Sep 17 00:00:00 2001 From: wernerkrauss Date: Tue, 16 Oct 2018 15:12:34 +0200 Subject: [PATCH] Fix broken template paths in $Content Use framework logic to get the templates of the current Widget Subclass --- src/Model/Widget.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Model/Widget.php b/src/Model/Widget.php index 6a32d4f..8864248 100644 --- a/src/Model/Widget.php +++ b/src/Model/Widget.php @@ -13,6 +13,7 @@ use SilverStripe\Forms\TextField; use SilverStripe\ORM\DataObject; use SilverStripe\ORM\FieldType\DBHTMLText; use SilverStripe\Versioned\Versioned; +use SilverStripe\View\SSViewer; /** * Widgets let CMS authors drag and drop small pieces of functionality into @@ -116,7 +117,7 @@ class Widget extends DataObject */ public function Content() { - return $this->renderWith(array_reverse(ClassInfo::ancestry(__CLASS__))); + return $this->renderWith(SSViewer::get_templates_by_class(static::class)); } /**