diff --git a/code/DocumentationParser.php b/code/DocumentationParser.php index 1a76dc4..fe5374c 100755 --- a/code/DocumentationParser.php +++ b/code/DocumentationParser.php @@ -193,7 +193,7 @@ class DocumentationParser { if($urlParts && isset($urlParts['scheme'])) continue; // Rewrite URL (relative or absolute) - $baselink = Director::makeRelative(dirname($page->getPath())); + $baselink = Director::makeRelative(dirname($page->getPath(false, false))); $relativeUrl = rtrim($baselink, '/') . '/' . ltrim($url, '/'); // Resolve relative paths diff --git a/code/models/DocumentationPage.php b/code/models/DocumentationPage.php index 83cff07..792f8ff 100755 --- a/code/models/DocumentationPage.php +++ b/code/models/DocumentationPage.php @@ -100,15 +100,14 @@ class DocumentationPage extends ViewableData { * will return the path of the first file in the folder * @return string */ - function getPath($defaultFile = false) { + function getPath($defaultFile = false, $realpath = true) { if($this->entity) { - $path = Controller::join_links( $this->entity->getPath($this->getVersion(), $this->lang), $this->getRelativePath() ); - if(!is_dir($path)) $path = realpath($path); + if(!is_dir($path) && $realpath) $path = realpath($path); else if($defaultFile) { $file = DocumentationService::find_page($this->entity, explode('/', $this->getRelativePath()));