mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR: Updated SiteTree->ElementName() to generate the identifier from the full link rather than the URLSegment.
From: Andrew Short <andrewjshort@gmail.com> git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@88509 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
72592d8c14
commit
8546a6d194
@ -411,6 +411,15 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
return Controller::join_links($base, '/', $action);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a CSS identifier generated from this page's link.
|
||||
*
|
||||
* @return string The URL segment
|
||||
*/
|
||||
public function ElementName() {
|
||||
return str_replace('/', '-', trim($this->RelativeLink(true), '/'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns TRUE if this is the currently active page that is being used to handle a request.
|
||||
*
|
||||
@ -466,16 +475,6 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the URL segment for this page, eg 'home'
|
||||
*
|
||||
* @return string The URL segment
|
||||
*/
|
||||
public function ElementName() {
|
||||
return $this->URLSegment;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if this page is in the given current section.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user