diff --git a/templates/list.tpl b/templates/list.tpl
index f5f50f22..b355bc14 100644
--- a/templates/list.tpl
+++ b/templates/list.tpl
@@ -51,8 +51,8 @@
|
-{foreach from=$RAW_items item=RAW_item}
- {assign "item" $items.{$RAW_item.$id_field|escape:"html"}} {* array keys in $items are html-escaped *}
+{foreach key=itemkey from=$RAW_items item=RAW_item}
+ {assign "item" $items.${itemkey|escape:"html"}} {* array keys in $items are html-escaped *}
{#tr_hilightoff#}
{foreach key=key item=field from=$struct}
@@ -66,7 +66,7 @@
{/if}
{if $table == 'foo' && $key == 'bar'}
- Special handling (complete table row) for {$table} / {$key} |
+ Special handling (complete table row) for {$table} / {$key} |
{else}
{if $table == 'foo' && $key == 'bar'}
|