Re: [htmltmpl] TMPL_VAR inside a TMPL_VAR
Brought to you by:
samtregar
From: LDT <per...@ya...> - 2004-01-09 16:01:27
|
I confess I don't completely understand what you suggested, but I tried the following and I receive an error that says "nc_rpt_summary.pl: HTML::Template : Attempt to set nonexistent parameter 'cell_fmt' - ..[blah].. at /nc_rpt_summary.pl line 599". I tried changing 'cell_fmt' in line 599 to 'title_bar'. I also tried it as 'some_var' (just to see what would happen) and the error message changes to reflect each variation I tried. I also tried putting Lines 598 and 599 in front of Line 593. No luck on any of this. Ln593: $tmpl_main->param(title_bar => "Rpt $rpt_no - $rpt_lbl", hdr_asofdt => "$rpt_asofdt", attr_fyr => $attr_fyr, passattrs => \@loop_attr, passdata => \@loop_data); Ln598: my $big_tmpl = HTML::Template->new( scalarref => \$cell_fmt ); Ln599: $big_tmpl->param( cell_fmt => $tmpl_main->output() ); Ln600: print $tmpl_main->output(); And a shortened snipped version of my .tmpl file: <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> <td <TMPL_VAR NAME=cell_fmt><TMPL_VAR NAME=col_cbud></td> </tr> </TMPL_LOOP> Timm Murray <tm...@ag...> wrote: At 07:08 AM 1/9/04 -0800, LDT wrote: <> >my $cell_fmt = <>align="right" style="cursor:pointer;cursor:hand;" > title="Click to drill down" > onmouseover="style.background='#CCCCFF';" > onmouseout ="style.background='> NAME=bgcolor>';"> >EOL >; > >$tmpl_main = HTML::Template->new( scalarref => \$cell_fmt ); >$tmpl_main->param( title_bar => "Rpt $rpt_no - $rpt_lbl", > hdr_asofdt => "$rpt_asofdt", > attr_fyr => $attr_fyr, > passattrs => \@loop_attr, > passdata => \@loop_data); >print $tmpl_main->output(); $tmpl_main only gets parameters that are visible inside $cell_fmt. Once those are set, you can put its output into the parameter of another template like this: my $big_tmpl = HTML::Template->new( . . . ); $big_tmpl->param( some_var => $tmpl_main->output() ); --------------------------------- Do you Yahoo!? Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes |