[英]Display all categories from news item
我有一个新闻类别更多的新闻。 如果我使用firstCategory,那么我会收到输出作为第一个所选类别,但这不是我想要的。 我想显示新闻项已标记为的所有类别。 我尝试了以下操作,但没有输出
<f:if condition=“{newsItem.categories}“>
<span class=“news-list-category label label-default test”>
<f:for each=“{categories}” as=“category”>
{category.title}
</f:for>
</span>
</f:if>
在for循环使用newsItem.categories
而不是categories
。 像下面。
<f:if condition=“{newsItem.categories}“>
<span class=“news-list-category label label-default test”>
<f:for each=“{newsItem.categories}” as=“category”>
{category.title}
</f:for>
</span>
</f:if>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.