Share » Forums » General » Number of Row for each Item with...

Number of Row for each Item with "fetch"?

Number of Row for each Item with "fetch"?

Wednesday 29 December 2004 7:49:00 am - 3 replies

Author Message

Tobias Persson

Wednesday 29 December 2004 10:36:50 am

You could do something like:

{set count=0 list_items=fetch_alias( children, hash( parent_node_id, $node.node_id, sort_by, $node.sort_array) )}
<table>
{section var=child loop=$list_items}
{set count=$count|inc}
 <tr><td>{$count}</td><td>{node_view_gui view=line content_node=$child}</td></tr>
{/section}
</table>

Balazs Halasy

Wednesday 29 December 2004 12:07:06 pm

Hi,

Here is a shorter/faster example:

<table>
{section var=Children loop=$list_items}
    <tr><td>
    {$Children.number}
    </td><td>
    {node_view_gui view=line content_node=$Children.item}
    </td></tr>
{/section}
</table>

For more info, look at the doc page for the section function:
http://ez.no/ez_publish/documentation/reference/template_functions/program_flow/section

Balazs

Peter Schnuerer

Sunday 02 January 2005 6:09:32 am

Thank you all!

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu