本文整理汇总了PHP中oxUBase::_prepareMetaDescription方法的典型用法代码示例。如果您正苦于以下问题:PHP oxUBase::_prepareMetaDescription方法的具体用法?PHP oxUBase::_prepareMetaDescription怎么用?PHP oxUBase::_prepareMetaDescription使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oxUBase
的用法示例。
在下文中一共展示了oxUBase::_prepareMetaDescription方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _prepareMetaDescription
/**
* 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);
}
示例2: _prepareMetaDescription
/**
* 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);
}
示例3: _prepareMetaDescription
/**
* 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);
}
示例4: _prepareMetaKeyword
/**
* 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);
}
示例5: _prepareMetaKeyword
/**
* 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);
}
示例6: _prepareMetaDescription
/**
* 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);
}