From 8546a6d19433a0acbb924ffc7a9515b6ae724d27 Mon Sep 17 00:00:00 2001 From: Andrew Short Date: Sun, 11 Oct 2009 00:07:26 +0000 Subject: [PATCH] MINOR: Updated SiteTree->ElementName() to generate the identifier from the full link rather than the URLSegment. From: Andrew Short git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@88509 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/SiteTree.php | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/core/model/SiteTree.php b/core/model/SiteTree.php index 4ce1f77a6..f79cf925b 100755 --- a/core/model/SiteTree.php +++ b/core/model/SiteTree.php @@ -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. *