public function LinkingMode() { //Check that we have a controller to work with and that it is a StaffPage if ($Controller = Controller::CurrentPage() && Controller::CurrentPage()->ClassName == 'CommPage') { //check that the action is 'show' and that we have a StaffMember to work with if (Controller::CurrentPage()->getAction() == 'show' && ($CommMember = Controller::CurrentPage()->getCommMember())) { //If the current StaffMember is the same as this return 'current' class return $CommMember->ID == $this->ID ? 'current' : 'link'; } } }