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.
I'm particularly interested in the idea of having more than one run-mode
visible on the page at the same time. Sort of like different panes in
a GUI application.
For example, MS Outlook or GNOME Evolution might show a mode-selecting
sidebar, a preview/editing pane and one or more query listings.
I could see a web application which shows multiple panes on one page:
two different renderings that are the (possibly cached) results of
queries, and another area for editing a "current" entity according to
a find-or-create scheme.
But this makes me fear the number of distinct database connections or
the overall feasibility of having more than one .cgi?rm=mode script
displayed on the same page. Maybe this is too aggressive a design for
a first project with these modules, but I'm thinking of future growth.
[ e d h a l l e y ]----------------------------------------------------
-----Original Message-----
From: Michael Peters [mailto:suppressed
Sent: Tuesday, February 22, 2005 12:22 PM
To: Halley, Edward D.
Cc: 'suppressed'
Subject: Re: [cgiapp] Using CGI::Application and SHTML/SSI pages?
Halley, Edward D. wrote:
> I've just started digging into CGI::Application and thinking about how
> to architect a small project of my own. Sorry if this is too basic,
> but Google didn't help me and this thread may help others.
>
> One question came to mind: I generally prefer to use one or two main
> .shtml files to give a site a basic layout, include all the style
> features. I then use Server Side Includes (SSI) to call on CGI scripts
> to build up portions of the page's content. I don't like making CGI
> scripts that output entire HTML pages. Also, though I know it's mostly
> irrational, I also don't like the ".cgi" appearing in a URL that people
> may end up cut-and-pasting to make links. At most, "http://foo/?bar=4"
> should clue the application if a parameter must be included in the URL.
>
> How compatible are these approaches? Can I make my CGI::App "run modes"
> implement only certain panes of an overall SHTML layout? If the pane
> wanted to provide a link to forward users to some other run mode, can I
> easily control the URL construction?
CGI::App is very flexible in this regard. In fact I've done something
similar in the past, except instead of filling in the whole page, I've
just had it fill in dynamic portions (like navigation based on login,
etc) for static pages (generated by the krang CMS).
C::A will just return to the browser what you return from your run mode.
The only exception is HTTP headers, but this can be turned off by
setting $self->header_type('none').
Also, may I suggest you at least look at doing this another way. If the
majority of you app is dynamic then I would either use the
cgiapp_postrun() to wrap your run mode's content in a similar look and
feel, or use something like the WRAPPER functionality of Template
Toolkit. This will let you control it from a central location and avoid
outside dependancies like SSI.
--
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.