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, biapar, Willr, Ingo, swaiba, simon_w

New page type with new template renders as just the page type name


Reply

2 Posts   624 Views

Avatar
zimm0r

8 January 2010 at 12:58pm Community Member, 2 Posts

Howdy doo. I've inherited a project for a client that is built on SilverStripe & this is my first time using it. I've been reading the book, the tutorials, and these forums, along with diving head first into the code, and I'm definitely making progress.

Unfortunately I've run into a problem I can't figure out & it seems like the solution will be something silly I've overlooked.

I created a new page type, CofExPage, and a new layout (the entire site uses 1 template with just a few layouts for other pages). I flushed everything & was able to select the new page type for the page I'm trying to redesign but after publishing it, when I go to the page, all it says is "CofExPage". Nothing else renders, no errors, no content, nada. I view-source and that's all that it's spitting out: "CofExPage", the name of my layout/page type.

Files I added:
CofExPage.php in /mysite/code
CofExPage.ss in the theme directory, in /templates/Layout

The other layouts & the rest of the site work fine (everything worked fine until I started mucking around!)

Any help would be greatly appreciated.

Avatar
zimm0r

8 January 2010 at 1:03pm Community Member, 2 Posts

Scratch that! Figured it out, and if any other beginners run into the problem:

CofExPage.php, I declared the controller

class CofEx_Controller extends Page_Controller

Should have been

class CofExPage_Controller extends Page_Controller

I left out the "Page".... d'oh. Make sure all those names match up!