[htmltmpl] TMPL_VAR inside a TMPL_VAR
Brought to you by:
samtregar
From: LDT <per...@ya...> - 2004-01-08 22:14:19
|
I'm running into an error when trying to pass a TMPL_VAR inside a TMPL_VAR and have it be evaluated. I've set global_vars = 1, so I was thinking that would help. I've included the pieces of my program, template and output. As you can see, most of the TMP_VARs are evaluated/passed, but the internal TMPL_VAR isn't (although it's also the same "bgcolor" variable used in the <tr> line, which I highlighted in bold below. Am I missing something, or am I trying to do something naughty? Within my main program: #set up format parameter for data cells in summary report my $cell_fmt = <<EOL align="right" style="cursor:pointer;cursor:hand;" title="Click to drill down" onmouseover="style.background='#CCCCFF';" onmouseout ="style.background='<TMPL_VAR NAME=bgcolor>';"> EOL ; #Pass parameters to template; print report $tmpl_main->param( cell_fmt => $cell_fmt, passdata => \@loop_data); print $tmpl_main->output(); Within my template: <TMPL_LOOP NAME=passdata> <tr class=<TMPL_VAR NAME=trclass> bgcolor=<TMPL_VAR NAME=bgcolor>> <td <TMPL_VAR NAME=cell_fmt><TMPL_VAR NAME=col_cfte></td> The relevant section of the results when I view the source of the page (after the "invalid argument" errors): <tr class=normal bgcolor=#FFFFFF> <td align="right" style="cursor:pointer;cursor:hand;" title="Click to drill down" onmouseover="style.background='#CCCCFF';" onmouseout ="style.background='<TMPL_VAR NAME=bgcolor>';"> <font color=#000000>$12,345.67</td> --------------------------------- Do you Yahoo!? Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes |