I am currently in the middle of doing this, and quite frankly its a pain in the ass!
So far I have added this to my dashboard modules _config.php file:
Director::addRules(50, array(
'admin/dashboard' => 'DashboardAdmin'
));
CMSMain::$url_segment = 'cms';
CMSMenu::replace_menu_item('CMSMain', 'Site Content', 'admin/cms/', null, 10);
And added this class to extend the CMS' main menu:
class DashboardAdmin extends LeftAndMain {
static $url_segment = '';
static $menu_title = 'Dashboard';
static $menu_priority = 99;
static $url_priority = 41;
/**
* Initialisation method called before accessing any functionality that RandomLinksAdmin has to offer
*/
public function init() {
parent::init();
Requirements::css('dashboard/css/Dashboard.css');
Requirements::customScript(file_get_contents(Director::baseFolder() . '/dashboard/javascript/Dashboard.js'));
}
...
}
?>
The most important lines are:
static $url_segment = '';
static $url_priority = 41;
These basically tell Silverstripe that your new class has a higher priority than CMSMain. Please note though that url_priority can't exceed 49!
Doing this overrides the default behaviour of the CMS, but for me has caused a load of new isses, so I am now trying to extend CMSMain to fix them, I will post back when I get a result :)
Mo