Hi!

I have on page multilevel list menu. To done this menu, I make multilevel array. For max two level menu in phptal, this works:
   <ul>
       <li tal:repeat="menuItem menuItems">
<a tal:attributes="href php:isset(menuItem['url'])?menuItem['url']:'#'" tal:content="menuItem/name"/>
           <ul tal:condition="php:menuItem['type']=='menu'">
               <li tal:repeat="menuItem_2 menuItem/children">
<a tal:attributes="href php:isset(menuItem_2['url'])?menuItem_2['url']:'#'" tal:content="menuItem_2/name"/>
               </li>
           </ul>
       </li>
   </ul>

If element is url - I give this url to href, if this is menu - after <a> element i add <ul> list with children of this menu. But what, if I want to do such as menu without any limits of levels? One way to do it is to prepare string in php with this menu, by recursion function, and then put it in phptal with structure expression.
But is there some way to do it in phptal?

cheers!
szymek

_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal

Reply via email to