[htmltmpl] [Question] H::T => using <TMPL_UNLESS> to trigger <TMPL_LOOP>
Brought to you by:
samtregar
From: C H. <hag...@ep...> - 2004-05-08 17:35:52
|
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 |