[PHPTAL] embedded repeats

Kris Quigley kris.quigley at gmail.com
Mon Apr 24 19:37:30 CEST 2006


Hi list, im trying to create dynamic lists which have a 2nd level.

I have tried the following, with errors "unexpected type_array".

This is my first list:
<ul>
      <li tal:repeat="item setup"><a tal:attributes="href
item/link_location; id item/class|null" tal:content="item/link_name"
tal:condition="item/hidden"></a></li>
</ul>

then i want to embed another like this:

<ul>
      <li tal:repeat="item setup"><a tal:attributes="href
item/link_location;                                                   
                          id item/class|null"
                                                                      
      tal:content="item/link_name"
                                                                      
      tal:condition="item/hidden"></a>
      <li tal:repeat="item2 item/setup2|null"><a tal:attributes="href
item2/link_location;
                                                                      
                        id item2/class|null"
                                                                      
                        tal:content="item2/link_name"
                                                                      
                        tal:condition="item2/hidden"></a></li>
</ul>

using this PHP, $sec_level is a multidimentional array.

    for($n = 0; $n <= count($nav) - 1; $n++){
      if($nav[$n]['unique_name'] == $name){
	$nav[$n]['class'] = "selected";
	$nav[$n]['setup2'] = $sec_level;
      }
    }


If anyone knows how to get tal:repeats to work within another repeat,
please let me know :)

If you need any more information just ask.


More information about the PHPTAL mailing list