We had a code for HomePage pagetype like so:
<?php class HomePage extends Page { static $db = array( 'Description' => 'Text' ); static $has_one = array( 'Photo' => 'Image' ); function getCMSFields() { $fields = parent::getCMSFields(); $fields->addFieldToTab('Root.Content.Main', new ImageField('Photo'), 'Content'); $fields->addFieldToTab('Root.Content.Main', new TextField('Description'), 'Content'); return $fields; } } class HomePage_Controller extends Page_Controller { } ?>
- For Removing the content u need to remove the content from the main tab using code:
<?php class HomePage extends Page { static $db = array( 'Description' => 'Text' ); static $has_one = array( 'Photo' => 'Image' ); function getCMSFields() { $fields = parent::getCMSFields(); $fields->removeFieldFromTab("Root.Content.Main","Content"); // removes the content from cms tab $fields->addFieldToTab('Root.Content.Main', new ImageField('Photo'), 'Content'); $fields->addFieldToTab('Root.Content.Main', new TextField('Description'), 'Content'); return $fields; } } class HomePage_Controller extends Page_Controller { } ?>
- After changing the code use yoursite.com/dev/build?flush=1
Looking for quality SilverStripe Web Hosting? Look no further than Arvixe Web Hosting!