But it gives error
in page i need field for height, weight, picture, video link, and the name
have made them using article holder and article page tutorial but something goed wrong.
The pages are called : ElevantPage.php , DigisilmPage.php
and holder name is: KaameraHolder.php
Codes Are
Digisilmpage.php :
<?php
/**
* Defines the ElevantPage page type
*/
class DigisilmPage extends Page {
static $db = array(
'Video' => 'Text',
'Pealkiri' => 'Text',
'Photo' => 'Image',
'Pikkus' => 'Text',
'Korgus' => 'Text'
);
static $has_one = array(
);
}
class DigisilmPage_Controller extends Page_Controller {
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Content.Main', new TextField('Video'), 'Content');
$fields->addFieldToTab('Root.Content.Main', new TextField('Pealkiri'), 'Content');
$fields->addFieldToTab('Root.Content.Main', new ImageField('Photo'), "Content");
$fields->addFieldToTab('Root.Content.Main', new TextField('Pikkus'), 'Content');
$fields->addFieldToTab('Root.Content.Main', new TextField('Korgus'), 'Content');
return $fields;
}
}
?>
ElevantPage.php:
<?php
/**
* Defines the ElevantPage page type
*/
class ElevantPage extends Page {
static $db = array(
'Video' => 'Text',
'Pealkiri' => 'Text',
'Photo' => 'Image',
'Pikkus' => 'Text',
'VideoKorgus' => 'Text'
);
static $has_one = array(
);
}
class ElevantPage_Controller extends Page_Controller {
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Content.Main', new TextField('Video'), 'Content');
$fields->addFieldToTab('Root.Content.Main', new TextField('Pealkiri'), 'Content');
$fields->addFieldToTab('Root.Content.Main', new ImageField('Photo'), 'Content');
$fields->addFieldToTab('Root.Content.Main', new TextField('Pikkus'), 'Content');
$fields->addFieldToTab('Root.Content.Main', new TextField('Korgus'), 'Content');
return $fields;
}
}
?>
And the holder page is
<?php
/**
* Defines the ArticleHolder page type
*/
class KaameraHolder extends Page {
static $allowed_children = array("DigisilmPage", "ElevantPage");
}
class KaameraHolder_Controller extends Page_Controller {
}
?>