Merge pull request #177 from wernerkrauss/patch-1

Fix broken template paths in $Content
This commit is contained in:
Robbie Averill 2018-10-16 15:29:38 +02:00 committed by GitHub
commit ade8047461
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

View File

@ -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)

View File

@ -20,6 +20,9 @@
"squizlabs/php_codesniffer": "^3.0"
},
"extra": {
"branch-alias": {
"dev-master": "2.x-dev"
},
"expose": [
"css",
"javascript"

View File

@ -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));
}
/**