私はLiferay 6.2 EEを使用しています。私は、次のスニペット実行することにより、FreeMarkerののWebコンテンツ・テンプレートの中に私のリスト要素のインデックスを取得したい:Liferay freemarkerテンプレート - リスト内のインデックスを使用する
<#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
を試みたが、 ...
パーフェクト。できます。あなたの助けに感謝します。 – HelmutSteiner
'?index'は推奨されていません。それは '?index'で廃止予定の' ..._index'です。明らかに、Liferayの前記バージョンは、古いFreeMarkerバージョンを使用しています。 – ddekany