17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1073 Views |
-
ArticlePage code not working... pointers???

16 January 2008 at 1:32pm
Hey guys,
Just beginning to extend the basic site using the tutorial... trying to mix and match some code and it just crashes my install.
Can anyone see anything wrong with the below?
<?php
class FeatureArticlePage extends Page {
static $db = array(
'Date' => 'Date'
'Author' => 'Text'
);
static $has_one = array(
'Photo' => 'Image'
);
static $defaults = array(
'ProvideComments' => true
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Content.Images', new ImageField('Photo'));
$fields->addFieldToTab('Root.Content.Main', new CalendarDateField('Date'), 'Content');
$fields->addFieldToTab('Root.Content.Main', new TextField('Author'), 'Content');
return $fields;
}
}class FeatureArticlePage_Controller extends Page_Controller {
}
?>
Cheers in advance.
-
Re: ArticlePage code not working... pointers???

16 January 2008 at 3:42pm
There needs to be a comma in your static $db (after 'Date'), like so:
static $db = array(
'Date' => 'Date',
'Author' => 'Text'
);Does this help?
-
Re: ArticlePage code not working... pointers???

22 January 2008 at 12:02pm
Yep that worked great!
Thanks heaps!
| 1073 Views | ||
|
Page:
1
|
Go to Top |


