/** * Extract the page abstract of the current frontend page * * @param \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController $fe Frontend engine * @param string $bodytext Fallback abstract * @return string Page abstract */ protected function _getPageAbstract(\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController $fe, $abstract = '') { // If there is an description meta tag ... if (($description = $this->_getMetaContent($fe, 'description')) !== null) { $abstract = $description; // Else: Return the page record abstract if given } elseif (isset($fe->page) && is_array($fe->page) && strlen(trim($fe->page['abstract']))) { $abstract = trim($fe->page['abstract']); } return $this->_csObj->strtrunc('utf-8', $abstract, 255); }
/** * Extracts the sample description text from the content array. * * @param array Content array * @return string Description string */ function bodyDescription($contentArr) { // Setting description $maxL = t3lib_div::intInRange($this->conf['index_descrLgd'], 0, 255, 200); if ($maxL) { // Takes the quadruple lenght first, because whitespace and entities may be removed and thus shorten the string more yet. # $bodyDescription = implode(' ',split('[[:space:],]+',substr(trim($contentArr['body']),0,$maxL*4))); $bodyDescription = str_replace(array(' ', TAB, CR, LF), ' ', $contentArr['body']); // Shorten the string: $bodyDescription = $this->csObj->strtrunc('utf-8', $bodyDescription, $maxL); } return $bodyDescription; }