mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
ENHANCEMENT Showing actual subsite base URL in CMS fields
This commit is contained in:
parent
e17ecfbdee
commit
d373b09908
@ -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'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user