Joomla在博客视图中获取普通文章标签
是否可以在joomlas blogview中为每一篇文章获取纯文本的文章标签?我发现了一个片段,但它以html呈现文章标记Joomla在博客视图中获取普通文章标签,joomla,joomla3.2,Joomla,Joomla3.2,是否可以在joomlas blogview中为每一篇文章获取纯文本的文章标签?我发现了一个片段,但它以html呈现文章标记 <?php if ($params->get('show_tags', 1) && !empty($this->item->tags)) : ?> <?php $this->item->tagLayout = new JLayoutFile('joomla.content.tags'); ?>
<?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; ?>
使用JLayout显示标签。这个问题出现在
/layouts/joomla/content/tags.php
中。
JLayout在模板中很容易被覆盖。
只需将该文件复制(或创建一个新文件)到
templates/your_template/html/layouts/joomla/content/tags.php
并根据需要进行调整。Joomla将自动使用该布局来显示标签。谢谢bakual,我找到了解决问题的另一种方法:
在模板blog.php
中,我添加了以下代码以纯文本格式显示特定的文章标记:
foreach ($item->tags->itemTags as $tag) echo $tag->title." "
我将其更正为:
<?php foreach ($item->tags->itemTags as $tag) : echo $tag->title; endforeach; ?>
不管怎样,它是有效的!
谢谢用户3014931