2013-11-20 65 views
1

是否有可能以純文本形式爲每篇文章獲取joomlas博客視圖中的文章標籤?我發現一個片段,但它呈現在html中的文章標籤...Joomla在博客視圖中獲取文章標籤

<?php if ($params->get('show_tags', 1) && !empty($this->item->tags)) : ?> 
    <?php $this->item->tagLayout = new JLayoutFile('joomla.content.tags'); ?> 

    <?php echo $this->item->tagLayout->render($this->item->tags->itemTags); ?> 
<?php endif; ?> 

回答

1

標籤顯示使用JLayout。有問題的是/layouts/joomla/content/tags.php。 JLayouts在您的模板中很容易覆蓋。 只需將該文件(或創建一個新文件)複製到templates/your_template/html/layouts/joomla/content/tags.php並根據需要進行調整。然後Joomla會自動使用該佈局來顯示標籤。

1

感謝bakual,我發現我的問題的另一個解決方案:

模板 blog.php

添加以下代碼,以顯示純文本格式的具體文章標籤:

foreach ($item->tags->itemTags as $tag) echo $tag->title." " 
0

我糾正一入:

<?php foreach ($item->tags->itemTags as $tag) : echo $tag->title; endforeach; ?> 

無論如何它的工作原理! 謝謝user3014931