Dataobject template not loading

Silverstripe 4.4.4

I have setup my Silverstripe 4 and am slowly updating a clients website from 3 to 4 which is a bit of a ball ache as it is quite different and I am not used to 4.

I have setup a dataobject page using the RegionsPage.php lessons number 9 so I can make sure it is correct. Everything is working backend. Problem I have is that the template is not showing. See code below. The main is showing but the in Layout is not showing with all the data and I can’t for the life of me work out what is what. Any help would be very helpful.





namespace SilverStripe\Lessons;

use SilverStripe\ORM\DataObject;
use SilverStripe\Assets\Image;
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\TextField;
use SilverStripe\Forms\TextareaField;
use SilverStripe\AssetAdmin\Forms\UploadField;
use SilverStripe\Versioned\Versioned;

class Testimonial extends DataObject {
  // Testimonial object's fields
  private static $db = [
    'Name' => 'Varchar(255)',
    'Description' => 'Text',
	  'Content' => 'Text',
    'Affiliation' => 'Varchar(255)',
	  'SortOrder' => 'Int',
  // One-to-one relationship with profile picture and Testimonial list page
  private static $has_one = [
    'ProfilePicture' => Image::class,
    'TestimonialsPage' => TestimonialsPage::class,
  // Summary fields
  private static $summary_fields = [
    'Name' => 'Name',
    'Description' => 'Description',
    'Affiliation' => 'Affiliation',
	'Content' => 'Content',

	    private static $owns = [
	private static $table_name = 'Testimonial';
	private static $extensions = [
	private static $default_sort = ['SortOrder ASC'];
	private static $versioned_gridfield_extensions = true;
	 public function getCMSFields()
        $fields = FieldList::create(
            $uploader = UploadField::create('ProfilePicture')


        return $fields;




namespace SilverStripe\Lessons;

use SilverStripe\Forms\GridField\GridField;
use SilverStripe\Forms\GridField\GridFieldConfig_RecordEditor;
use Symbiote\GridFieldExtensions\GridFieldOrderableRows;
use Page;

class TestimonialsPage extends Page {
  // One to many relationship with Testimonial object
  private static $has_many = [
    'Testimonials' => Testimonial::class,
private static $owns = [
	public function getCMSFields()
		// $config = GridFieldConfig_RecordEditor::create();
    	// $config->addComponent(new GridFieldOrderableRows('SortOrder'));
        $fields = parent::getCMSFields();
        $fields->addFieldToTab('Root.Testimonials', GridField::create(
            'Testimonial list:',
            // $config

        return $fields;


namespace SilverStripe\Lessons;
use PageController;
class TestimonialsPageController extends PageController

Your Page and Controller are both in the namespace SilverStripe\Lessons, so you need to make your template directory structure match that as well.

You’ll want it at: themes/skilltec/templates/SilverStripe/Lessons/Layout/

(I think !)

As an aside, it’s best not to use ‘SilverStripe’ as your top-level namespace. Generally speaking it should be something specific to the application or the vendor creating the code, to help reduce the chances of namespace collisions and autoloading problems down the line.

Thanks for your help

Okay I have changed the namespace and added the appropriate folder hierarchy to the themes folder but get this when flushing the front end not the template or parent.


Did you change the page type in the CMS and re-publish the page?

Okay so what I did is to start again and add my own vendor folder and add my extensions and templates there which I suppose how it should work. I then added namespaces to these elements of the path and it seemed to find them. I assume there was something not right with the namespace paths I was using.