mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-09-29 20:59:10 +02:00
Fixes #139 - Broken URL Segment CMS Links
Fixes issue #139 using normann's solution that seems to work perfectly with both long and short links.
This commit is contained in:
parent
2a6c913cd8
commit
38e4bc196d
@ -99,10 +99,8 @@ class SiteTreeSubsites extends DataExtension {
|
|||||||
($nested_urls_enabled && $this->owner->ParentID ? $this->owner->Parent()->RelativeLink(true) : null)
|
($nested_urls_enabled && $this->owner->ParentID ? $this->owner->Parent()->RelativeLink(true) : null)
|
||||||
);
|
);
|
||||||
|
|
||||||
$url = (strlen($baseLink) > 36 ? "..." .substr($baseLink, -32) : $baseLink);
|
|
||||||
|
|
||||||
$urlsegment = $fields->dataFieldByName('URLSegment');
|
$urlsegment = $fields->dataFieldByName('URLSegment');
|
||||||
$urlsegment->setURLPrefix($url);
|
$urlsegment->setURLPrefix($baseLink);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user