Despite reading and re-reading tutorial http://doc.silverstripe.org/framework/en/tutorials/2-extending-a-basic-site I can't see what I missed... but I think it's probably fairly fundamental...
I want to add a field (Jack) to my page type. So page.php says:
class Page extends SiteTree {
private static $db = array();
private static $has_one = array('SingleImage' => 'Image'
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Jack',$uploadField = new UploadField($name = 'Jack', $title = 'JackRussell'));
return $fields;
}
}
And on my page I call the image:
$Jack
Can upload image in CMS using field 'Jack'. But no image on the page?!
Did I miss anything?