Hi all. New to Silverstripe, so far I think it's a great tool, having lots of fun learning. Have been trying to add new fields to the CMS and am having some trouble. Followed the tutorials on adding Date and Author fields, from there figured out how to add two new text fields and pull them into the CMS:
class HomePage extends Page {
static $db = array(
'Recent Work' => 'Text',
'New Work' => 'Text'
);
static $has_one = array(
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Content.Main', new TextField('Recent Work'));
$fields->addFieldToTab('Root.Content.Main', new TextField('New Work'));
return $fields;
}
}
The problem I'm having is that I can't get the fields to display text-wrapping. Right now, they both show up under $Content, which is where I want them, but they only display a single line. I'd like them to function similarly to the $Content field - e.g. expanding as needed when data dictates. Also, the default font that is applied to content in these new fields appears different to that applied to data put into the $Content field. I know fonts will be handled on the site by my CSS, but it seems odd that new fields don't correspond with the existing format. Might be useful if the tutorial addressed this type of customization as opposed to just the single line examples. Thanks in advance for any help and or insights.