Skip to content

Commit

Permalink
Merge pull request tractorcow-farm#723 from olivernorden-silverstripe…
Browse files Browse the repository at this point in the history
…/feature/disable-locale-link-prepend

feat(site tree extension): add option to disable locale prepend to link
  • Loading branch information
tractorcow authored Jul 12, 2021
2 parents c2bb9e1 + e120dce commit e0578bd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Extension/FluentSiteTreeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ public function getLinkToXDefault()
*/
public function updateRelativeLink(&$base, &$action)
{

if ($this->owner->hasMethod('disablePrependLocaleURLSegmentToLink') && $this->owner->disablePrependLocaleURLSegmentToLink()) {
return;
}
// Don't inject locale to subpages
if ($this->owner->ParentID && SiteTree::config()->get('nested_urls')) {
return;
Expand Down

0 comments on commit e0578bd

Please sign in to comment.