Oops ... sorry Mark, looks like you did send this to list and not just me. ;)

As i said in my previous email (which only Mark saw) ... just use the scalar
output of Data::Dumper and call it a day. However, the example _I_ spoke of
does give a generic template. Here it is again:

<table>
    [% FOREACH key = hash.keys %]
        [% val = hash.$key %]
        <tr>
            <th>[% key %]</td>
            <td>
                [% IF val.keys %]
                    [% INCLUDE debug.tt hash=val %]
                [% ELSE %]
                    [% val %]
                [% END %]
            </td>
        </tr>
    [% END %]
</table>

Good luck ... and don't waste your time on this ... it's silly when
Data::Dumper or similar already does a decent job, decent enough that i use it
here at work for debugging our Web App.

jeffa

--- "Thomas, Mark - BLS CTR" <[EMAIL PROTECTED]> wrote:
> OK, I've obtained the Badger book, and see this example. It's nice, and the
> output would be fine for my purposes. Unfortunately, though, it requires
> that you know the name(s) of the keys of the hash passed to Template.pm. Is
> there any way to make a generic template that will dump all the data
> available to the template?
> 
> In other words, is there something like 
>   [% FOREACH _root.keys %]
> 
> where "_root" is a reference to the anon hash passed to Template.pm?
> 
> - Mark.
> 
> -- 
> Mark Thomas                    [EMAIL PROTECTED]
> Internet Systems Architect     User Technology Associates, Inc.
> 
> $_=q;KvtuyboopuifeyQQfeemyibdlfee;; y.e.s. ;y+B-x+A-w+s; ;y;y; ;;print;;
>  
> 
> > -----Original Message-----
> > From: Jeff Anderson [mailto:[EMAIL PROTECTED] 
> > Sent: Friday, February 06, 2004 3:00 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [Templates] Turning templates over to a non-programmer
> > 
> > 
> > Dunno about the graphics stuff, but the New Template book 
> > (Badger book) has a small section that shows you how to build 
> > an easy to read HTML debug page. Pages  419-422 in chapter 11.
> > 
> > jeffa
> > 
> > --- "Thomas, Mark - BLS CTR" <[EMAIL PROTECTED]> wrote:
> > > Hello all,
> > >  I have just started experimenting with TT2, and like it so 
> > much that 
> > > I'm already planning to convert several in-house projects 
> > over to TT2. 
> > > What's great with the complete separation of code and 
> > presentation and 
> > > that I can delegate page design to a non-programmer.
> > > 
> > > What would be really nice is a way to automatically 
> > generate a visual 
> > > tree representing the data structure that is available in the 
> > > template, allowing the designer to see at a glance what they can 
> > > insert into the template.
> > > 
> > > I envision:
> > >  1. A graphical representation of the data structure (perhaps
> > >     GraphViz::Data::Grapher or something similar). The output
> > >     of Data::Dumper is not friendly enough.
> > >  2. A method to automatically intercept a data structure from
> > >     perl before it is sent to the template, so that it can be
> > >     visualized as above. It would be best if this did not
> > >     require changing the script or the template.
> > > 
> > > Maybe the above can be accomplished with a special template, using 
> > > certain TT2 plugins. That would be way cool. I'm not yet familiar 
> > > enough with TT2 to know for sure if this is possible.
> > > 
> > > Has anyone done something like this before?
> > > 
> > > 
> > > -- 
> > > Mark Thomas                    [EMAIL PROTECTED]
> > > Internet Systems Architect     User Technology Associates, Inc.
> > > 
> > > 
> > > _______________________________________________
> > > templates mailing list
> > > [EMAIL PROTECTED] 
> > > http://lists.template-toolkit.org/mailman/listinfo/templates
> > 
> > 
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Finance: Get your refund fast by filing online. 
> http://taxes.yahoo.com/filing.html
> 
> _______________________________________________
> templates mailing list
> [EMAIL PROTECTED]
> http://lists.template-toolkit.org/mailman/listinfo/templates
> 
> 
> _______________________________________________
> templates mailing list
> [EMAIL PROTECTED]
> http://lists.template-toolkit.org/mailman/listinfo/templates


__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you�re looking for faster
http://search.yahoo.com

_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to