Jump to:

23364 Posts in 18125 Topics by 2862 members

General Questions

SilverStripe Forums » General Questions » New page type with new template renders as just the page type name

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

Page: 1
Go to End
Author Topic: 602 Views
  • zimm0r
    Avatar
    Community Member
    2 Posts

    New page type with new template renders as just the page type name Link to this post

    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.

  • zimm0r
    Avatar
    Community Member
    2 Posts

    Re: New page type with new template renders as just the page type name Link to this post

    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!

    602 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.