From 41c9ecffe667dd15f214e2a8451a965d8641e9b2 Mon Sep 17 00:00:00 2001 From: Dylan Wagstaff Date: Fri, 15 Jun 2018 17:52:55 +1200 Subject: [PATCH 1/2] Add supported module badge to readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index b6256da..69968b4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Widgets Module [![Build Status](http://img.shields.io/travis/silverstripe/silverstripe-widgets.svg)](https://travis-ci.org/silverstripe/silverstripe-widgets) +[![SilverStripe supported module](https://img.shields.io/badge/silverstripe-supported-0071C4.svg)](https://www.silverstripe.org/software/addons/silverstripe-commercially-supported-module-list/) [![Code Quality](http://img.shields.io/scrutinizer/g/silverstripe/silverstripe-widgets.svg)](https://scrutinizer-ci.com/g/silverstripe/silverstripe-widgets) [![Code Coverage](https://img.shields.io/codecov/c/github/silverstripe/silverstripe-widgets.svg)](https://codecov.io/gh/silverstripe/silverstripe-widgets) From 5d2f0570d88742dca00f06d57a82849cde7f0d77 Mon Sep 17 00:00:00 2001 From: wernerkrauss Date: Tue, 16 Oct 2018 15:12:34 +0200 Subject: [PATCH 2/2] 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)); } /**