ENHANCEMENT Showing actual subsite base URL in CMS fields

This commit is contained in:
Ingo Schommer 2008-12-02 04:06:58 +00:00
parent e17ecfbdee
commit d373b09908

View File

@ -94,6 +94,18 @@ class SiteTreeSubsites extends DataObjectDecorator {
if($this->owner->MasterPageID) {
$fields->insertFirst(new HeaderField('This page\'s content is copied from a master page: ' . $this->owner->MasterPage()->Title, 2));
}
// replace readonly link prefix
$subsite = $this->owner->Subsite();
if($subsite && $subsite->ID) {
$baseUrl = 'http://' . $subsite->domain() . '/';
$fields->removeByName('BaseUrlLabel');
$fields->addFieldToTab(
'Root.Content.Metadata',
new LabelField('BaseUrlLabel',$baseUrl),
'URLSegment'
);
}
}
/**