【发布时间】:2014-04-27 15:26:46
【问题描述】:
我想在 joomla 2.5.x 中使用文章描述部分(元描述)作为第二个标题。
并将其放在标题旁边的文章中。
为此,我使用以下命令。
<?php
jimport( 'joomla.document.document' );
function getDescription() {
return $this->description;
}
echo "<h3>".getDescription()."</h3>";
?>
我把它放在下面的文件中,但是没有用。
components\com_content\views\article\tmpl\default.php
【问题讨论】:
-
我还没有测试过,但你可能只能
echo $this->item->metadesc;。 -
谢谢。我找到了另一种方式。$doc =JFactory::getDocument(); $meta_description = $doc->getMetaData("description"); echo "
".$meta_description."
";