/**
  * Returns current view meta data
  * If $meta parameter comes empty, sets to it article title and description.
  * It happens if current view has no meta data defined in oxcontent table
  *
  * @param string $meta           User defined description, description content or empty value
  * @param int    $length         Max length of result, -1 for no truncation
  * @param bool   $descriptionTag If true - performs additional duplicate cleaning
  *
  * @return string
  */
 protected function _prepareMetaDescription($meta, $length = 200, $descriptionTag = false)
 {
     if (!$meta) {
         $article = $this->getProduct();
         if ($this->getConfig()->getConfigParam('bl_perfParseLongDescinSmarty')) {
             $meta = $article->getLongDesc();
         } else {
             $meta = $article->getLongDescription()->value;
         }
         if ($meta == '') {
             $meta = $article->oxarticles__oxshortdesc->value;
         }
         $meta = $article->oxarticles__oxtitle->value . ' - ' . $meta;
     }
     return parent::_prepareMetaDescription($meta, $length, $descriptionTag);
 }
Exemplo n.º 2
0
 /**
  * Returns current view meta data
  * If $sMeta parameter comes empty, sets to it current content title
  *
  * @param string $sMeta     category path
  * @param int    $iLength   max length of result, -1 for no truncation
  * @param bool   $blDescTag if true - performs additional duplicate cleaning
  *
  * @return string
  */
 protected function _prepareMetaDescription($sMeta, $iLength = 200, $blDescTag = false)
 {
     if (!$sMeta) {
         $sMeta = $this->getContent()->oxcontents__oxtitle->value;
     }
     return parent::_prepareMetaDescription($sMeta, $iLength, $blDescTag);
 }
Exemplo n.º 3
0
 /**
  * Returns current view meta data
  * If $sMeta parameter comes empty, sets to it article title and description.
  * It happens if current view has no meta data defined in oxcontent table
  *
  * @param string $sMeta     category path
  * @param int    $iLength   max length of result, -1 for no truncation
  * @param bool   $blDescTag if true - performs additional dublicate cleaning
  *
  * @return string
  */
 protected function _prepareMetaDescription($sMeta, $iLength = 1024, $blDescTag = false)
 {
     if (!$sMeta && $this->getConfig()->getConfigParam('bl_perfLoadAktion') && ($oArt = $this->getFirstArticle())) {
         $oDescField = $oArt->getLongDescription();
         $sMeta = $oArt->oxarticles__oxtitle->value . ' - ' . $oDescField->value;
     }
     return parent::_prepareMetaDescription($sMeta, $iLength, $blDescTag);
 }
 /**
  * Returns current view keywords separated by comma
  *
  * @param string $keywords              Data to use as keywords
  * @param bool   $removeDuplicatedWords Remove duplicated words
  *
  * @return string
  */
 protected function _prepareMetaKeyword($keywords, $removeDuplicatedWords = true)
 {
     $keywords = '';
     if ($activeCategory = $this->getActiveCategory()) {
         $keywordsList = array();
         if ($categoryTree = $this->getCategoryTree()) {
             foreach ($categoryTree->getPath() as $category) {
                 $keywordsList[] = trim($category->oxcategories__oxtitle->value);
             }
         }
         $subCategories = $activeCategory->getSubCats();
         if (is_array($subCategories)) {
             foreach ($subCategories as $subCategory) {
                 $keywordsList[] = $subCategory->oxcategories__oxtitle->value;
             }
         }
         if (count($keywordsList) > 0) {
             $keywords = implode(", ", $keywordsList);
         }
     }
     $keywords = parent::_prepareMetaDescription($keywords, -1, $removeDuplicatedWords);
     return trim($keywords);
 }
Exemplo n.º 5
0
 /**
  * Returns current view keywords separated by comma
  *
  * @param string $sKeywords               data to use as keywords
  * @param bool   $blRemoveDuplicatedWords remove duplicated words
  *
  * @return string
  */
 protected function _prepareMetaKeyword($sKeywords, $blRemoveDuplicatedWords = true)
 {
     $sKeywords = '';
     if ($oCategory = $this->getActiveCategory()) {
         $aKeywords = array();
         if ($oCatTree = $this->getCategoryTree()) {
             foreach ($oCatTree->getPath() as $oCat) {
                 $aKeywords[] = trim($oCat->oxcategories__oxtitle->value);
             }
         }
         if (count($aKeywords) > 0) {
             $sKeywords = implode(", ", $aKeywords);
         }
         $aSubCats = $oCategory->getSubCats();
         if (is_array($aSubCats)) {
             foreach ($aSubCats as $oSubCat) {
                 $sKeywords .= ', ' . $oSubCat->oxcategories__oxtitle->value;
             }
         }
     }
     $sKeywords = parent::_prepareMetaDescription($sKeywords, -1, $blRemoveDuplicatedWords);
     return trim($sKeywords);
 }
Exemplo n.º 6
0
 /**
  * Returns current view meta data
  * If $sMeta parameter comes empty, sets to it article title and description.
  * It happens if current view has no meta data defined in oxcontent table
  *
  * @param string $sMeta     user defined description, description content or empty value
  * @param int    $iLength   max length of result, -1 for no truncation
  * @param bool   $blDescTag if true - performs additional dublicate cleaning
  *
  * @return string
  */
 protected function _prepareMetaDescription($sMeta, $iLength = 200, $blDescTag = false)
 {
     if (!$sMeta) {
         $oProduct = $this->getProduct();
         $sMeta = $oProduct->getArticleLongDesc()->value;
         $sMeta = $oProduct->oxarticles__oxtitle->value . ' - ' . $sMeta;
     }
     return parent::_prepareMetaDescription($sMeta, $iLength, $blDescTag);
 }