我有一个getResources调用,结果大致如下:
我可以按标签分类:
效果很好。这是我的密码:
[[!getResourcesTag?
&parents=2`
&tagKey=`Tags`
&showHidden=`1`
&tpl=`datesTpl
&limit=`3`
&includeContent=`1`
&includeTVs=`1`
&processTVs=`1`
&tvPrefix=``
&hideContainers=`1`
&pageLimit=`10`
]]现在轮到我了,这给我带来了麻烦。我想把结果按月分组。所以我想要达到的结果是:
2016年1月
2016年1月1日-新年午餐(会议)
2015年12月
2015年11月
输出日期的电视名为" date“。这台电视给我的每一个条目一个时间戳输出。例如:"2015-12-11 00:56:00“。我写了一个片段(formatDate),它稍后输出我想要的格式。我就是这样用的:
[[formatDate? &date=`[[+date]]`]]所以我想我可以用档案专家来解决这个问题。但这是行不通的。不知何故它不处理我的电视。这是我的代码:1
[[!ArchivistGrouper? &parents=`2` &itemTpl=`datesTpl` &includeTVs=`1` &tvPrefix=`` &includeContent=`1` &processTVs=`1`]]我对档案石斑鱼的研究结果是:
2016年1月
2015年12月
2015年11月
因此,我的问题是,我是否可以得到我希望的结果也在getResources?或者你有什么办法让它运行!我希望你能帮上忙。我对每一个微笑的暗示都很高兴
发布于 2015-12-28 16:28:58
发布于 2016-07-13 19:54:46
这会把它按年分开。
[[pdoNeighbors?
&id=`[[+id]]`
&tplWrapper=`@INLINE [[+next]]`
&sortby=`publishedon`
&sortdir=`asc`
&tplNext=`@INLINE [[+publishedon:strtotime:date=`%Y`]]`
&toPlaceholder=`neighborYear`
]]
[[+neighborYear:notequalto=`[[+year]]`:then=`<h3>[[+neighborYear]]</h3>`]]
<dt>[[+publishedon:strtotime:date=`%m/%d/%Y`]]</dt>
<dd><a href="[[~[[+id]]]]" [[+link_attributes]] title="[[+pagetitle]]">[[+pagetitle]]</a></dd>
[[+publishedon:strtotime:date=`%Y`:toPlaceholder=`year`]]若要按年份和月份进一步细分它,请使用%Y%m
https://stackoverflow.com/questions/34495235
复制相似问题