From: Joachim Kohlhammer <joachim.kohlhammer@gm...> - 2002-09-02 20:22:31
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:
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,
From: Sam Tregar <sam@tr...> - 2002-09-02 21:54:33
On Mon, 2 Sep 2002, Joachim Kohlhammer wrote:
> It seems like the TMPL_INCLUDE is evaluated before the other code is run
> through. Is this correct?
Yes. The <tmpl_include> works like a #include in C - it reads in the file
as soon as it is reached by the parser. The upside is that this means you
could have the start of a <tmpl_loop> inside a header.tmpl and the
</tmpl_loop> inside a footer.tmpl. The downside is that you can't
recursively include a template inside itself.
From: Will <self_deprecated@ya...> - 2002-09-03 15:23:10
I am working on H::T loops. Right now I am looking to
pull info out of MySQL via Perl's DBI module, and then
stuff that data into HTML tables generated by H::T.
I know that to use H::T loops feature, I'll have to
(if I have this right) sort of "nest" a hash in an
array, but I am not sure of how to create the hash in
a way H::T will be able to work with it.
DBI supports a number of different method calls, like
fetchrow_hashref and others, but I am not sure if
these would work.
Does anyone have any good advice on how to get through
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
From: Chris Davies <Chris.Davies@ManheimEurope.com> - 2002-09-03 16:15:47
Will [self_deprecated@...] wrote:
> I am working on H::T loops. Right now I am looking to
> pull info out of MySQL via Perl's DBI module, and then
> stuff that data into HTML tables generated by H::T.
> Does anyone have any good advice on how to get through
If you do a search in the mailing list archives for words like "fetchrow" you'll
see a plethora of examples and suggestions.
Chris Davies, Manheim Online
Tel. 0113 393-2004 Fax. 0870 444-0482. Mobile 07778 199069