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

Re: [cgiapp] directory structure and static pages


Andy Taylor wrote:
I'm getting ready to start a fairly large project using CGI::App and I was just wondering how some of the more experienced/knowledgeable people on this list handle some issues.

1. if you are doing a project with a superclass and several modules, where do you put your templates and how do you organize them? For instance, if /home/ataylor is my home dir, do most people do something like /home/ataylor/project/modules and /home/ataylor/project/templates and put all the templates in one big directory?

I'm working with HTML::Template.  My directory structure looks like:

/var/www/webapps/ <-- for the .pl files, e.g. FooBar.pl
/var/www/applibs/ <-- for the .pm files, e.g. FooBar.pm, SuperClass.pm
/var/www/apptmpl/FooBar <-- for the .html (or .tmpl) template files (or .html static files) pertaining to FooBar.pl and FooBar.pm /var/www/apptmpl/BazQuux <-- for the .html (or .tmpl) template files (or .html static files) pertaining to BazQuux.pl and BazQuux.pm /var/www/apptmpl/.common-SuperClass <-- for common files to all programs that derive from SuperClass.pm (e.g. FooBar.pm and BazQuux.pm)

Note that this .common-SuperClass directory makes the most sense in the context of the &CGI::Application::load_tmpl method patch I sent to the mailing list yesterday.

This isn't necessarily the best way to do it. It's just something I'm trying out right now. It doesn't immediately seem to suck hard.

2. for a large project, not all of the pages have to be dynamic obviously. How do people deal with static pages that you want to still share the look of your dynamic pages that you are using HTML::Template for? I was considering creating a commandline tool to generate the static pages from the HTML::Templates or creating a module just for serving static pages (not that they would be static anymore) and wrapping the header and footer, setting the title, etc. but each of these have downsides. How do the experts do it?

Beats me, I'm not an expert. :-) What you're describing there is a common problem to any web application. Some people like stylesheets, I hear. I have nothing original (or decent) to contribute to this point.

Cheers,
Richard



---------------------------------------------------------------------
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.