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.

Archive /

Our old forums are still available as a read-only archive.

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

can't create a new page type - trying to debug how /db/build works

Go to End

12 Posts   5024 Views


Community Member, 224 Posts

20 May 2008 at 5:01pm


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

class Page_Controller extends ContentController {
function init() {



Copy the main Page.php in mysite/code to a new file named with the same name as your theme file...
Then change the two lines of code
class MyPage extends SiteTree {
class MyPage_Controller extends ContentController {


Forum Moderator, 5521 Posts

20 May 2008 at 5:04pm

And you also dont need to call Requirements again if you extend page FTW.


Community Member, 7 Posts

23 August 2008 at 4:36am

I think there is some confusion. In the tutorial section there is no instruction to put the HomePage.php, the ArticlePage.php or the ArticleHolder.php files in the mysite/code directory. I had the same problem while going through the tutorial and after about 30 minutes came here to find an answer. I moved the php files to the mysite/code directory and then flushed the db and it worked fine. Is this an error in the tutorial?

I am so far pretty impressed with the extensibility of this cms.


Forum Moderator, 5521 Posts

23 August 2008 at 12:11pm

Well the tutorials / installation is a bit confusing with 2 folders where they could be but basically the idea is that while you are running through the tutorial you install with the 'tutorial' option hence all your code paths are /tutorial/code/* but if you install with the BlackCandy option then your code paths are /mysite/code/*

Go to Top