[htmltmpl] Includes and recursion
Brought to you by:
samtregar
From: Joachim K. <joa...@gm...> - 2002-09-02 20:22:31
|
Hi all, I have a question regarding TMPL_INCLUDE. At the moment I am writing new templates for BINS (http://bins.sautret.org), which uses HTML::Template. It features a Album Tree which is at the moment created in the Perlscript. You can see a example at http://album.sautret.org/tree.html. I want to move the creation of this tree in a template. The following came to mind: treeloop.html: <li> <TMPL_VAR NAME="ALBUM_NAME"> <TMPL_IF NAME="HAS_SUBALBUM"> <ul> <TMPL_LOOP NAME="SUBALBUM"> <TMPL_INCLUDE NAME="treeloop.html"> </TMPL_LOOP> </ul> </TMPL_IF> </li> But this doesn't work, it gives me the message HTML::Template->new() : likely recursive includes - parsed 10 files deep and giving up (set max_includes higher to allow deeper recursion). at /usr/share/perl5/HTML/Template.pm line 2108. The version of HTML::Template is 2.5. It seems like the TMPL_INCLUDE is evaluated before the other code is run through. Is this correct? If yes, is there a way to control recursion using IF's and LOOP's? If no, where is my mistake? Thanks for your help, Joachim |