[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [OT] Template Toolkit



I'll keep this as brief as I can, since we've gone way off-topic.

In Template Toolkit, common HTML is kept in templates.  You can "call"
the templates within your source HTML file.  This is what a source file
might look like, kind of:

[% WRAPPER template_main title = 'A Specific Page' %]
<p>This is the stuff that varies</p>
[% USE customer = getdata('mydatabase', 'customers') %]
[% PROCESS customer_template %]
[% END %]

template_main contains all the 'boilerplate' code, <HTML> to </HTML>. 
You'd change this anytime you wanted to change the overall look of your
pages (link bars, etc.)  Notice you can pass parameters to it, the page
title in this case.
Within it, it includes the stuff between [% WRAPPER %] and [% END %].

getdata is a plugin that fetches the customer data for you.  It would be
written in Perl.

customer_template would contain the HTML that formats the customer data
into <TABLE>,<TD>, etc.  It would typically have a [% FOR %] loop that
goes through the data and sticks it into tags.

You can generate all the pages in your site from these templates with
one command.  Also note that you can generate the pages on-request as
well as statically, as desired.

The benefits?  No redundant editing, code separated from HTML,
fantastically responsive support by the author.

If you just don't want to use a text editor or Perl, forget about it.

Otherwise, see http://www.template-toolkit.org for details.

I used FrontPage, then Dreamweaver for a bit, but Template Toolkit is
the way to go for me.  I find that WYSIWYG has a really short learning
curve, but in the long run you're wasting a lot of time futzing around
with the mouse, not to mention trying to fix the weird HTML such tools
sometimes generate.

Really, if I actually wanted to do it the GUI way, I'd probably just do
it under Win9x and forget about it.

Joris Lambrecht wrote:
> 
> Sorry for the ignorance but how does this template system work ?
> I can't imagine the benefits from this kind of approach.
> 
> -----Original Message-----
> From: Richard Taylor [mailto:exile@21stcentury.net]
> Sent: Tuesday, February 20, 2001 11:15 PM
> To: debian-user@lists.debian.org
> Subject: Re: [OT] Re: WYSIWYG HTML Editor
> 
> >   From: "Keith G. Murphy" <keithmur@mindspring.com>
> >Steve wrote:
> 
> >> It's like the argument that b4 good page layout apps like Quark were as
> >> good as they are that the pros used to write their own postcript. Now
> most
> >> pros use a professional page layout app like Quark because it truly is
> >> WYSIWYG and almost no one writes their own postscript anymore. =)
> >>
> >> Why? Because it's faster and makes fewer mistakes, in business time is
> >> money.
> >>
> >> That's why most pros now do use a quality html layout app like
> DreamWeaver
> >> UltraDev, because it does the whole enchilada and is really very good.
> >>
> >It's certain that purely hand-editing a large site wastes a lot of
> >time.  But the thing left out of this discussion is templating systems
> 
>  It's not "certai" at all.
> 
> >like Template Toolkit.  They can get rid of all your redundant hand
> >editing.
> 
>  Like copy and paste.
> 
> >And HTML generation is easy to automate with one of those, where I'm
> >sure postscript wouldn't be, so the above analogy doesn't really extend
> >to those.
> >
> >Not saying UltraDev isn't good.  I rather liked the standard
> >DreamWeaver, but I have no interest in a WYSIWYG tool now.
> 
>  http://freshmeat.net/browse/751/
> 
> --
> To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact
> listmaster@lists.debian.org
> 
> --
> To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: