public function getTitle() { // See if the index action has already cached the associated page // (This is a big speedup) $slug = $this->getVirtualPageSlug(); if (aTools::isPageCached($slug)) { $titleSlot = aTools::getCachedPage($slug)->getSlot('title'); } else { $titleSlot = $this->Page->getSlot('title'); } if ($titleSlot) { $result = $titleSlot->value; } else { $result = $this['slug']; } $title = trim($result); if (!strlen($result)) { // Don't break the UI, return something reasonable $slug = $this->slug; $title = substr(strrchr($slug, "/"), 1); } return $title; }