在字段更改时输出特定文本
Output specific Text on field change
有个小问题
我有一个带有日期字段的扩展程序。
有一整年的事件列表,我想按月对它们进行分组。
为此,我想输出一个包含月份的标题,并且在日期字段中的月份每次更改时,都应打印一个新标题。
我该如何管理?
有没有简单的方法?
实际代码如下所示:
<f:link.action action="show" arguments="{operation:operation}" pageUid="{settings.operationSinglePid}">
<table>
<tr>
<td width="70px">[{operation.number}]</td>
<td width="170px"> <f:if condition="{operation.begin}">
{operation.begin -> f:format.date(format:'d.m.Y, H:i \U\h\r')}
</f:if></td>
<td width="260px">Stichwort:
<f:for each="{operation.type}" as="stichwort">
{stichwort.title}
</f:for>
</td>
<td width="300px"> <f:if condition="{operation.location}">
<span>{operation.location}</span>
</f:if>
</td>
</tr>
</table>
</f:link.action>
问候并感谢您
萨沙乌尔班斯基
使用像 vhs:variable.set
这样的视图助手,设置循环之前的月份,并将每次循环迭代中的此变量与当前变量进行比较。如果它发生变化,请再次更改变量。
或者,如果您的数据结构适合,请使用 groupedFor 视图助手。
有个小问题
我有一个带有日期字段的扩展程序。
有一整年的事件列表,我想按月对它们进行分组。
为此,我想输出一个包含月份的标题,并且在日期字段中的月份每次更改时,都应打印一个新标题。
我该如何管理?
有没有简单的方法?
实际代码如下所示:
<f:link.action action="show" arguments="{operation:operation}" pageUid="{settings.operationSinglePid}">
<table>
<tr>
<td width="70px">[{operation.number}]</td>
<td width="170px"> <f:if condition="{operation.begin}">
{operation.begin -> f:format.date(format:'d.m.Y, H:i \U\h\r')}
</f:if></td>
<td width="260px">Stichwort:
<f:for each="{operation.type}" as="stichwort">
{stichwort.title}
</f:for>
</td>
<td width="300px"> <f:if condition="{operation.location}">
<span>{operation.location}</span>
</f:if>
</td>
</tr>
</table>
</f:link.action>
问候并感谢您
萨沙乌尔班斯基
使用像 vhs:variable.set
这样的视图助手,设置循环之前的月份,并将每次循环迭代中的此变量与当前变量进行比较。如果它发生变化,请再次更改变量。
或者,如果您的数据结构适合,请使用 groupedFor 视图助手。