public function CMSThumbnail() { if ($this->PreviewImage()->exists()) { return $this->PreviewImage()->getFormattedImage('CMSThumbnail'); } return parent::CMSThumbnail(); }
/** * @return String HTML */ public function getPreview() { $preview = $this->extend('getPreview'); if ($preview) { return $preview; } if ($this->file) { return $this->file->CMSThumbnail(); } else { // Hack to use the framework's built-in thumbnail support without creating a local file representation $tmpFile = new File(array('Name' => $this->Name, 'Filename' => $this->Name)); return $tmpFile->CMSThumbnail(); } }