Typo3 中分组新闻项目的格式月份
format month of grouped news items in 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>
等等。
我有新闻项目,按年份和月份分组。这里的代码:
<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>
等等。