[英]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.