Thanks for replying.
I've put Debug::show('Pagename') in Teaserable, but nothing special showed up (or even happend).
The hierarchy is like:
FolderPage
|-> Page
|-> DefaultPage
Output generated is:
TESTCHILDREN TESTCONTROL TESTCONTROL
Page.php
class Page extends SiteTree {
public static $has_one = array(
'Logo' => 'Image'
);
public function getCMSFields(){
$fields = parent::getCMSFields();
return $fields;
}
}
class Page_Controller extends ContentController {
public function init() {
parent::init();
Requirements::css(DEFAULT_THEME_DIR.'/css/default.css');
}
/**
* Can this page be teaserd by a folderPage
* @return bool
*/
public function Teaserable(){
Debug::show('PAGE');
return 0;
}
}
DefaultPage.php
class DefaultPage extends Page {
public static $db = array(
);
public static $has_one = array(
);
public static $has_many = array('Imageattachments' => 'DefaultPageImageattachment');
public function getCMSFields(){
$fields = parent::getCMSFields();
return $fields;
}
}
class DefaultPage_Controller extends Page_Controller {
public function init() {
parent::init();
Requirements::css(DEFAULT_THEME_DIR.'/css/add.standard.css');
}
/**
* Can this page be teasered by a FolderPage
* @return bool
*/
public function Teaserable(){
Debug::show('DEFAULTPAGE');
return 1;
}
}
FolderPage.php
class FolderPage extends Page {
public static $db = array(
'LayoutView' => "enum('ALL_ON_ONE,ALL_AS_ACC,SUBPAGE_TSR','ALL_ON_ONE')",
'ForwardToSubpage' => 'Boolean'
);
public function getCMSFields(){
$fields = parent::getCMSFields();
$fields->renameField('Title', _t('FolderPage.FOLDERNAME'));
$layoutView = new DropdownField('LayoutView', _t('General.LAYOUTVIEW'), array(
'ALL_ON_ONE' => _t('FolderPage.ALL_ON_ONE'),
'ALL_AS_ACC' => _t('FolderPage.ALL_AS_ACC'),
'SUBPAGE_TSR'=> _t('FolderPage.SUBPAGE_TEASER')
),
'ALL_ON_ONE'
);
$forward = new CheckboxField('ForwardToSubpage', _t('FolderPage.FORWARD_TO_SUBPAGE'));
$fields->addFieldToTab('Root.Content.Main', $layoutView, 'Title');
$fields->addFieldToTab('Root.Content.Main', $forward);
return $fields;
}
}
class FolderPage_Controller extends Page_Controller {
public function init() {
parent::init();
Requirements::css(DEFAULT_THEME_DIR.'/css/add.standard.css');
Requirements::css(DEFAULT_THEME_DIR.'/css/add.folder.css');
}
}