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

Re: [cgiapp] Using CGI::Application and SHTML/SSI pages?


Cees Hek wrote:
On Tue, 22 Feb 2005 14:13:04 -0500, Halley, Edward D.
<suppressed> wrote:

Halley, Edward D. wrote:

Thanks for the tips-- I'll look at Template Toolkit but I'm not
particularly fond of templates; it feels like the tail wagging the dog.

Michael Peters wrote:

Really? I'm *so* glad that there are good templating solutions out
there. Separating the content from the code is a godsend.

That's what CSS and the wrapping HTML are for.  That's why an HTML
file which calls on one or more CGIs to render small, simply-
formatted lists is preferable (unless the server can't cope).  In my
CSS, I can say that any <LI> inside a given <SPAN CLASS="foo">
appears in a given style.  Then all my CGI must print is <LI>item 1
<LI>item 2 ...  The CGI needs to know no style, no formatting,
nothing but a bare <LI>.  It can get more complicated, but not much.


This is no different from using templates.  I prefer to keep all the
HTML in the same place (the templates) regardless of whether it is
styled using CSS or directly in the HTML.  Your approach would put
some of the HTML in SSI files, and some of the HTML in your CGI
scripts.  Regardless of how simple the HTML in your CGI scripts is, it
still splits things up.  Also, you limit what the desingers can do
with the layout (unless you are also the designer).  If your code
provides a list of <LI> items, but the designer wants to put the data
into 3 columns, can that still be done with CSS?  (I'm not a CSS
expert, so I'm not sure about that one)

Not to beat an already bludgeoned dead horse, for me, I use templates for the same reason that I use Class::DBI. I don't want to have some other language spread out inside of my perl code. Whether it's SQL (which is only present in small quantities in my Class::DBI model classes) or HTML.

--
Michael Peters
Developer
Plus Three, LP


---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
             http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.