Oh my goodness, I heart the Site Config -- just discovered it in 2.4alpha last night and spent all night haXXoring and came up with a brilliant (if I do say so myself) way of extending it via the Data Object Decorator (thank-you, thank-you, thank-you to the SS Team for dreaming up this beauty! you've saved me SOOOO much time!). I just wanted to share how I got extra fields into the Site Config screen really quickly for anyone who might be looking:
In mysite/_config.php, add the line
DataObject::add_extension('SiteConfig', 'SiteConfigOverride');
In mysite/code/ create a file called "SiteConfigOverride.php" and put the following into it:
<?php
class SiteConfigOverride extends DataObjectDecorator{
function extraStatics() {
return array(
"AddressLn1" => "Varchar(255)"
)
);
}
public function updateEditFormFields(FieldSet &$fields) {
$fields->addFieldToTab("Root.Main", new TextField("AddressLn1", _t('SiteConfig.ADDRESSLN1',"Address Ln 1")));
}
}
?>
I've found that you need to have the closing PHP tag in this file or SS dies a horrible white screen death without throwing errors, but that's ok, b/c it only took 5 mins to fix. Hopefully this will help someone that was in my situation. I've posted a fuller tutorial-ish explanation on our site at http://kiveo.net/extending-silverstripe-siteconfig