RE: [htmltmpl] Comparing H::T:Expr variables
Brought to you by:
samtregar
From: Chris <chr...@co...> - 2003-11-20 01:11:18
|
Hi Matt, Thank you so much for the reply. I had tried that, and that change yeilds the following error: HTML::Template->new() : Syntax error in <TMPL_*> tag at index.tmpl : 14. at /usr/lib/perl5/site_perl/5.8.0/HTML/Template.pm line 2243. Yes, I am using use HTML::Template::Expr; in my perl script and it is the newest version. The new template file looks like: <TMPL_LOOP ROWS> <br> <br> <TMPL_VAR NAME=MODEL_NAME> <br> <img src="<TMPL_VAR NAME=MODEL_THUMB>" border=0 height=100 width=100> <br> Can be seen at: <TMPL_LOOP URLLOOP> Model Name: <TMPL_VAR NAME=MODEL_NAME> Model Comp: <TMPL_VAR NAME=MODEL_COMP> <TMPL_IF EXPR=MODEL_COMP eq MODEL_NAME"> Model Name: <TMPL_VAR NAME=MODEL_NAME> Model Comp: <TMPL_VAR NAME=MODEL_COMP> The URL on match: <TMPL_VAR NAME=MODEL_URL> </TMPL_IF> </TMPL_LOOP> </TMPL_LOOP> <br> with the updated "EXPR" Thanks!!! > -----Original Message----- > From: Mathew Robertson [mailto:mat...@re...] > Sent: Wednesday, November 19, 2003 7:28 PM > To: Chris; htm...@li... > Subject: Re: [htmltmpl] Comparing H::T:Expr variables > > > > > I seems that when I call: > > > > Model Name: <TMPL_VAR NAME=MODEL_NAME> > > Model Comp: <TMPL_VAR NAME="MODEL_COMP"> > > > > from within: <TMPL_LOOP URLLOOP> > > > > It prints the correct data. > > > > Now.. Since that works, am I just using the: > > > > <TMPL_IF NAME="MODEL_COMP eq MODEL_NAME"> > > > > Statement WRONG? The data between the IF statement never gets displayed. > > Yep, you need to use <TMPL_IF EXPR="MODEL_COMP eq MODEL_NAME"> > > Note the "EXPR". > > That should fix it... > > Mathew |