Hoping someone can shed some light ...
I have a template that calls a loop:
<!--TMPL_LOOP EDITRES -->
Bunch of template HTML stuff here
<!--/TMPL_LOOP EDITRES -->
And this works fine. What I'd like to do is
use a conditional in the template so that the
loop is only specified when a certain parameter
is present on the script side ...
<!--TMPL_UNLESS NAME="intro_error_notice" -->
<!--TMPL_LOOP EDITRES -->
<!--/TMPL_UNLESS -->
Bunch of template HTML stuff here
<!--TMPL_UNLESS NAME="intro_error_notice" -->
<!--/TMPL_LOOP EDITRES -->
<!--/TMPL_UNLESS -->
But when I try this, I get the error:
HTML::Template->new() : found <//TMPL_UNLESS>
with no matching <TMPL_IF> at
/path/to/template/file/here/template.tmpl : line 21.
at /usr/lib/perl5/site_perl/5.6.1/HTML/Template.pm line 2117.
I have confirmed that the conditional value is being passed ..
if I use:
<!--TMPL_UNLESS NAME="intro_error_notice" -->
<h4><!--TMPL_VAR NAME=intro_error_notice --></h4>
<!--/TMPL_UNLESS -->
The value displays. So, I guess my question is, am I asking
H::T to do something it isn't able to do?
Carl Hagstrom
From: Roger B. W. <ro...@fi...> - 2004-05-08 17:41:00
On Sat, May 08, 2004 at 10:59:00AM -0400, C Hagstrom wrote:
>The value displays. So, I guess my question is, am I asking
>H::T to do something it isn't able to do?
No, but you're misunderstanding the tree structure. The entire
loop.../loop needs to be within the unless.../unless.
Roger