17488 Posts in 4473 Topics by 1978 members
| Go to End | ||
| Author | Topic: | 4318 Views |
-
Re: can't create a new page type - trying to debug how /db/build works

20 May 2008 at 5:01pm
<?php
class Page extends SiteTree {
static $db = array(
);
static $has_one = array(
);
}class Page_Controller extends ContentController {
function init() {
parent::init();
Requirements::themedCSS("layout");
Requirements::themedCSS("typography");
//Requirements::themedCSS("form");
}
}?>
Copy the main Page.php in mysite/code to a new file named with the same name as your theme Page.ss file...
MyPage.php
Then change the two lines of code
class MyPage extends SiteTree {
class MyPage_Controller extends ContentController { -
Re: can't create a new page type - trying to debug how /db/build works

20 May 2008 at 5:04pm
And you also dont need to call Requirements again if you extend page FTW.
-
Re: can't create a new page type - trying to debug how /db/build works

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.
-
Re: can't create a new page type - trying to debug how /db/build works

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/*
| 4318 Views | ||
| Go to Top |



