How to display news articles grouped by year with TYPO3 Versatile news system

佐手、 提交于 2019-12-12 01:56:25

问题


I tried to show a list of news articles with the LIST-Modul grouped by year. The year itself should be displayed as headline for each group of articles. Like

2014
--------
article 1
article 2
article 3
--------
2013
--------
article 4
article 5
...

I tried to implement it with the f:groupedFor viewhelper in the standard list.html template of the extension. inside the pagedNews part. But TYPO3 throws the exception: http://wiki.typo3.org/Exception/CMS/1237900529

I also tried the viewhelper mentioned here: https://gist.github.com/daKmoR/1287203 and read the question here Display list of elements grouped by year and by month in TYPO3 Fluid

Both seams not to work inside news templates


回答1:


I finally got the viewhelper to work.

Here is my little extension based on https://gist.github.com/daKmoR/1287203

https://github.com/unconnect/news_grouped_by_date

With this I was able to group news by year.



来源:https://stackoverflow.com/questions/26383772/how-to-display-news-articles-grouped-by-year-with-typo3-versatile-news-system

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!