On Thu, Jul 28, 2005 at 03:02:17PM -0400, Jesse Erlbaum wrote:
> What you've just described in the second paragraph is a compelling
> argument *AGAINST* automating your page creation, as described in the
> first.
Oh, I agree...I just find myself doing so many menial updates. Change
fieldname in data, change fieldname in 5 templates. change fieldname
type in data, change 5 templates. But I'm afraid the level of
abstraction I hope for is call "designer". :)
> means, assume away. If you're using TT, then chances are your HTML
> person also has Perl chops.
Not remotely. Just because there is power to abuse does NOT mean it
should be. Someday I vow to write a TT intro that reflects that, where
the current docs are practically a list of thigns to avoid.
Our TT is done much like HTML::Template, save for methods, nested data,
and Plugins. Plugins, allowing me to pull unrelated code out of my app
AND the template, were the reason we moved to TT away from
HTML::Template (which I otherwise enjoyed). My Designer, however,
doesn't quite grasp the concepts of IF or FOREACH, so I have to do a lot
of the template pre-coding.
Sigh.
> If you don't mind putting presentation dependencies into your Perl
> code, then automate away. (It's anathema to me, but maybe it works
> for your environment.)
No, it's against my personal practices as well. I just begin most
projects with templates that are something like (these aren't really my
variable names):
[% FOREACH Field = Record.Fields %]
[% IF loop.first %]
<table border="0">
[% END %]
<tr>
<td>[% Field %]:</td>
<td>[% Record.$Field %] </td>
</tr>
[% END %]
Which works just fine, and is reasonably durable, but not pretty. But
after the designer is done, many fields are treated differently, the
loop is entirely gone, and every change at a higher level involves
changing several templates. I was unable to think of a specific way to
fix this that wasn't more work. (such as tagging the data with
metadata, and "simply" specifying how that metadata would afffect the
display...sort of a CSS for building HTML). I just hoped that someone
was smarter than I was :)
--
SwiftOne / Brett Sanger
[EMAIL PROTECTED]
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/[email protected]/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]