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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Template not found

Go to End



Community Member, 39 Posts

23 April 2010 at 10:19pm

I just encountered a strange behaviour of template renderer.
My Page_Controller looks as follows:

class Page_Controller extends ContentController {
 function xml() {
  $this->getResponse()->addHeader('Content-Type', 'application/xml; charset="utf-8"');
  return array();

And then I have several page types extending both Page and Page_Controller, so I can use different templates. But for a strange reason one of my subclasses does not find an existing template.
I have templates/ template that looks like these:

<page id="$ID">

And in templates/Layout folder, for example:

When calling example-page/xml, it renders correctly using and Layout/
But for a strange reason one of my subclasses, let's say TestPage, cannot find an existing template, so it renders using and then (not
Every other class in the project works perfectly.

I triple checked everything for typos and anything. Does anyone encountered this problem?
I tried deleting the pages, the classes, rebuilding the database, flushing templates - no can do, my existing TestPage_xml template is simply ignored.
What could I miss?