mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Refactored CMS page-URL accessing to use ->AbsoluteLink(), which can be overridden by defining alternateAbsoluteLink()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@41283 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
896e7bfd95
commit
51c1e7ffec
@ -24,6 +24,15 @@ class SiteTree extends DataObject {
|
||||
return Director::baseURL() . $this->URLSegment . "/$action";
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the absolute URL for this page by stage
|
||||
*/
|
||||
public function AbsoluteLink() {
|
||||
if($this->hasMethod('alternateAbsoluteLink')) return $this->alternateAbsoluteLink();
|
||||
else return Director::absoluteURL($this->Link());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns link/current, depending on whether you're on the current page.
|
||||
* This is useful for css styling of menus.
|
||||
|
Loading…
Reference in New Issue
Block a user