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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

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

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


Go to End


2 Posts   991 Views

Avatar
zimm0r

Community Member, 2 Posts

8 January 2010 at 12:58pm

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

Community Member, 2 Posts

8 January 2010 at 1:03pm

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!