diff --git a/Classes/Encoder/UrlEncoder.php b/Classes/Encoder/UrlEncoder.php index ea247b8e..ca54358a 100644 --- a/Classes/Encoder/UrlEncoder.php +++ b/Classes/Encoder/UrlEncoder.php @@ -483,6 +483,14 @@ protected function createPathComponentUsingRootline() { unset($overlay); } } + // if pathoverride is set, use pathsegment also for all subpages to shorten the url and throw away all segments found so far + if ($page['tx_realurl_pathoverride'] && !empty($page['tx_realurl_pathsegment'])) { + $segment = $this->utility->convertToSafeString(trim($page['tx_realurl_pathsegment'], '/'), $this->separatorCharacter); + $components = array($segment); + continue; + } + + foreach (self::$pageTitleFields as $field) { if (isset($page[$field]) && $page[$field] !== '') { $segment = $this->utility->convertToSafeString($page[$field], $this->separatorCharacter); @@ -490,13 +498,15 @@ protected function createPathComponentUsingRootline() { $segment = $this->emptySegmentValue; } $components[] = $segment; - $this->appendToEncodedUrl($segment); continue 2; } } } if (count($components) > 0) { + foreach ($components as $segment) { + $this->appendToEncodedUrl($segment); + } $this->addToPathCache(implode('/', $components)); } }