Nest Loops

Nest Loops

Thursday 11 March 2004 6:27:57 pm - 2 replies

Author Message

Tobias Persson

Thursday 11 March 2004 11:38:02 pm

I had about the same problems at first. I solved it by not using the name attribute in sections. Try something like this:

<TABLE>
{section loop=$order.product_items show=$order.product_items sequence=array(bglight,bgdark)}

<tr>
<td >{$:item.object_name}<input type='hidden' name="eventName[]" value = "{$:item.object_name}"> </TD>

{section loop=$:item.item_object.option_list}
<td>{$:item.value}<input type='hidden' name="eventoption[]" value ="{$:item.value}"></TD>
{/section}

<TD>Name: </TD><TD><input type='text' name="regName[]"></TD>

</TR>

{/section}
</TABLE>

Paul Forsyth

Friday 12 March 2004 2:03:04 am

If you are using 3.3 you can use the new section 'var' parameter. This greatly simplifies the need for names everywhere.

Eg:

{section loop=$loop var=Myloop}
{$MyLoop.item}

{section loop=$loop2 var=MyOtherloop}
{$MyOtherLoop.item}
{/section}

{/section}

Take a look at the new doco:

http://ez.no/ez_publish/documentation/reference/template_functions/program_flow/section

paul

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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.