typo3 - Typo3 中分组新闻项目的格式月份
问题描述
我有新闻项目,按年和月分组。这里的代码:
<f:groupedFor each="{paginatedNews}" as="groupedNews1" groupBy="yearOfDatetime" groupKey="year">
<f:groupedFor each="{groupedNews1}" as="groupedNews" groupBy="monthOfDatetime" groupKey="month">
<div style="border:1px solid blue;padding:10px;margin:10px;">
<h1>{month} {year} </h1>
<f:for each="{groupedNews}" as="newsItem">
<f:render partial="List/Item" arguments="{newsItem: newsItem,settings:settings,iterator:iterator}" />
</f:for>
</div>
</f:groupedFor>
</f:groupedFor>
不幸的是,月份和年份在前端以数字显示,例如
03 2019
..(some news items)
02 2019
...
01 2019
但是,我需要的是:
March 2019
...
February 2019
...
January 2019
我怎样才能做到这一点?
解决方案
在原来的 EXT:news 上已经使用了这个方法:
查看模板 EXT:news/Resources/Private/Templates/News/DateMenu.html
<f:translate key="month.{month}" />
在 EXT:news/Resources/Private/Language/locallang.xlf 你会发现:
<trans-unit id="month.01" xml:space="preserve">
<source>January</source>
</trans-unit>
等等。
推荐阅读
- java - 我们可以在另一个项目中添加一个可执行的 jar 文件作为依赖项吗?
- javascript - 如何为 snapshotChanges lisitner 设置限制
- ios - Expo Permissions askAsync 方法不返回
- c# - 如何将函数应用于具有 Windows 窗体的绑定文本框?
- django - 我的 marketing_message 仅显示在 index.html 中,其余页面中间件不显示营销消息
- dockerfile - docker curl 返回意外的文件结尾
- c# - USB serial communication with C#, Linux permission question
- azure-active-directory - Azure Automation | Cannot grant 'User Access Administrator' role to service principle
- liquibase - 如何在没有 liquibase.exception.DatabaseException 的情况下使用 liquibase 将连接表迁移到实体表:错误:列“id”包含空值
- java - How to access Spring Boot Quartz Bean from another module?