Hi Guys,
I'm really new to Silverstripe but loving it. I just have one really important question for the website I'm designing. I've got a field on all of my page types called GalleryID and what I'd like to happen is for child pages when created to take the value of their parent page's GalleryID until they're given a value of their own. Does that make sense? Any help would be much appreciated!!
The very start of my page.php is:
class Page extends SiteTree {
public static $db = array(
'Sidebar' => 'HTMLText',
'GalleryID' => 'Int'
);
public static $has_one = array(
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Content.Sidebar', new HtmlEditorField('Sidebar', ''));
$fields->addFieldToTab('Root.Content.Main', new NumericField('GalleryID','Gallery ID'), 'Content');
return $fields;
}
}