diff --git a/code/BlogTree.php b/code/BlogTree.php index 1f3333c..0668b48 100644 --- a/code/BlogTree.php +++ b/code/BlogTree.php @@ -348,6 +348,30 @@ class BlogTree_Controller extends Page_Controller { return false; } + + /** + * @return String + */ + function SelectedAuthor() { + if($this->request->getVar('author')) { + $hasAuthor = BlogEntry::get()->filter('Author', $this->request->getVar('author'))->Count(); + return $hasAuthor ? Convert::raw2xml($this->request->getVar('author')) : null; + } elseif($this->request->getVar('authorID')) { + $hasAuthor = BlogEntry::get()->filter('AuthorID', $this->request->getVar('authorID'))->Count(); + if($hasAuthor) { + $member = Member::get()->byId($this->request->getVar('authorID')); + if($member) { + if($member->hasMethod('BlogAuthorTitle')) { + return Convert::raw2xml($member->BlogAuthorTitle); + } else { + return Convert::raw2xml($member->Title); + } + } else { + return null; + } + } + } + } function SelectedNiceDate(){ $date = $this->SelectedDate(); diff --git a/templates/Layout/BlogHolder.ss b/templates/Layout/BlogHolder.ss index 47a86c6..cd0bf7d 100644 --- a/templates/Layout/BlogHolder.ss +++ b/templates/Layout/BlogHolder.ss @@ -5,17 +5,11 @@ <% include BreadCrumbs %> <% if SelectedTag %> -