Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Themes /

Discuss SilverStripe Themes.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Doesn't show templates\ - only templates\Layout\

Go to End

5 Posts   2610 Views


Community Member, 49 Posts

31 January 2009 at 5:36pm

I'm running silverstripe 2.3.0-rc3 (but had the same issue in 2.3.0-rc2) and after creating some templates i'm only able to get a single template to show at a time.

I have the following template files


So obviously \themes\awesome\templates\ is the main template and the templates under \themes\awesome\templates\Layout\ should be injected in the space where $Layout is in the main template \themes\awesome\templates\

However, when I try to access a page that uses either \themes\awesome\templates\Layout\ or \themes\awesome\templates\Layout\, only the HTML markup from that template is displayed and the surrounding HTML markup from \themes\awesome\templates\ is missing.

Here is an example of the 2 templates:

\themes\awesome\templates\ (still a work in progress ;)

<html lang="en">
		<% base_tag %>
		<link rel="stylesheet" type="text/css" href="/awesome/css/screen.css" />
		<div id="page">
			<div id="header">
				<a title="Awesome" class="logo" href="/"><img src="" alt="Awesome"></a>
					<li><a href="#">Section</a></li>
			<div id="content">
				<div id="sidebar">
					<h2>Side Bar</h2>
			<div id="footer">

\themes\awesome\templates\Layout\ (which should be injected into $Layout in the above template)

<div id="main">

Instead of getting the two combined templates, I only get the later.

What am I doing wrong? Have I missed something? Has anyone else had this issue?


Community Member, 501 Posts

1 February 2009 at 3:42am


How do you get it to use them? I suppose you have a pagetype Detail and one Section then (Detail.php and Section.php)? Otherwise it won't work unless you do it manually with renderWith(array("Section", "Page"));

Perhaps if you pastie your php code I can tell you more.


Community Member, 49 Posts

1 February 2009 at 6:20pm

Edited: 01/02/2009 6:30pm

Totally weird :)

Not sure if this helps, but i'm running WAMP as the development server...

Below is the php code for both Page and Section (both of which appear fine in the SS Admin)



class Page extends SiteTree {
	public static $db = array(
	public static $has_one = array(

class Page_Controller extends ContentController {





class Section extends Page {
	public static $db = array(
		'Tagline' => 'Text'
	public static $has_many = array(
		'Detail' => 'Detail',
		'Sizes' => 'FilterSizeType'
	static $allowed_children = 'none';
	static $defaults = array(
		'ShowInSearch' => false,
		'ShowInMenus' => true
	function getCMSFields() {
		// Size List
		$sizesList = new HasManyComplexTableField(
				'Sexes' => 'Guys/Girls',
				'SizeName' => 'Size Name',
				'SizeAbbreviation' => 'Size Abbreviation',
				'Sequence' => 'Sequence'
		$fields = parent::getCMSFields();
		$fields->addFieldToTab('Root.Content.Main', new TextareaField('Tagline'), 'Content');
		$fields->addFieldToTab( 'Root.Content.Sizes', $sizesList );
		$fields->removeFieldFromTab('Root.Content.Main', "MenuTitle");
		$fields->removeFieldFromTab('Root.Content.Main', "Content");
		return $fields;

class Section_Controller extends ContentController {


I am using SVN and am starting to going backwards in the versions to see where this issue begins in this project... Will add any info if I find anything else ;)


Forum Moderator, 5523 Posts

1 February 2009 at 10:07pm

class Section_Controller extends ContentController {

That should be

class Section_Controller extends Page_Controller {


Community Member, 49 Posts

2 February 2009 at 7:44pm

Thanks Will (and dio5) for your help - that fixed the problem.