Liferay freemarker 模板 - 在列表中使用索引

Liferay freemarker template - Using index in list

我正在使用 Liferay 6.2 EE。我想通过执行以下代码片段在 freemarker Webcontent-Template 中检索我的列表元素的索引:

 <#list cross_sellings_header.crossSellingsTile.getSiblings() as cross_selling>
         ${cross_selling?index}
         .... <#-- some implementation -->      
 </#list>

但我收到一条错误消息:

Error on line 214, column 42, in template 20155#20195#ESHOP ARTIKEL Found index, expecting one of: chunk, is_date, is_hash, float, matches, time, number_to_datetime, byte, substring, is_transform, web_safe, iso_ms_nz, groups, seq_contains, iso, is_method, eval, iso_ms, iso_utc_m_nz, parent, capitalize, number, if_exists, is_directive

我也试过index_of但是没成功...

?index已弃用,正确的语法是:

${cross_selling_index}

来源: Freemarker list documentation