[PHPTAL] Best way to make a list of list

Guillaume Lecanu Guillaume at lya.fr
Fri Aug 8 22:46:10 CEST 2008


Le vendredi 08 août 2008 à 17:24 +0100, Kornel Lesiński a écrit :

> On 08-08-2008 at 17:18:31 Guillaume Lecanu <Guillaume at lya.fr> wrote:
> 
> > But all the structure is stored in DB, so I don't know in advance if one
> > menu have 1, 2, or 10 childrens, and I don't know if a children is a
> > submenu.
> >
> > I know how to do that in PHP without PHPTAL, but how is it possible to
> > do that kind of XHTML code with PHPTAL ?
> 
> Of course. You can use macros called recursively:
> 
> <ul metal:define-macro="list" tal:condition="list">
> 	<li tal:repeat="item list">...
> 		<tal:block metal:use-macro="list" tal:define="list item/sublist" />
> 	</li>
> </ul>

Interresting, I'll try this.


Thanks Kornel & Iván

-------------- section suivante --------------
Une pi�ce jointe HTML a �t� enlev�e...
URL: http://lists.motion-twin.com/pipermail/phptal/attachments/20080808/b2936314/attachment.htm


More information about the PHPTAL mailing list