{* Grab all the guestbook entries. *}
{let name=test counter=0 children=fetch( content,
list,
hash( parent_node_id,
$node.node_id,
sort_by,
$node.sort_array
)
)
}
Value of counter at this point: {$:counter}<br />
<table>
{* Loop through all the entries. *}
{section loop=$:children}
<br />
{* Increment the counter by one. *}
{set counter=$:counter|sum($:item.object.data_map.umsatz)}
<tr><td>
Umsatz value: <i>{$:item.object.data_map.umsatz.content|wash}</i>
</td></tr>
{* End of loop. *}
{/section}
<tr><td><hr /></td></tr>
</table>
<div class="center">
total Umsatz: {$:counter}
</div>
{* Release the counter and the children variable. *}
{/let}
It returns the values of the 4 objects of the class "frabo" in node 47: Umsatz value: 1
Umsatz value: 12500
Umsatz value: 20000
Umsatz value: 500000
but wenn the code should return the sum of the "total umsatz" , it returns:
total Umsatz: 24
now that is rather strange, because all we don?t know where this value '24' comes from. the total umsatz should add up to 532 501.