Re: [htmltmpl] TMPL_IF and TMPL_ELSE - how do I use this?
Brought to you by:
samtregar
From: P K. <pk...@ei...> - 2004-02-17 19:51:14
|
LDT wrote: > I've read the documentation sections on TMPL_IF and TMPL_ELSE. The > part where I'm getting stuck is figuring out how to set up that "BOOL" > value. I know if "BOOL" is true, then the section in TMPL_IF is run; > if it's false, the section in TMPL_ELSE is run. This sounds like what > I want to do (I think...). > > I have my results generated and the web page looks nice. However, > there are some rows that need to have a different bit of HTML in it > (some rows/cells are to be "drillable" and some are not). > Unfortunately, it's not just the "last" or "first", etc.; the rows are > interspersed in no particular order, some are contiguous, some are > stand-alone. you will have to set up some variable that is present in every row, and then set that variable to 1 or 0... @rows = ( {drillable=>0......}, {drillable=>0......}, {drillable=>1......} ); then, in your loop <tmpl_loop rows> <tmpl_if drillable>print drillable cells<tmpl_else>print cells</tmpl_if> </tmpl_loop> |