Re: [cgiapp] Hybrid static/dynamic site
Joel, You might also look at using Template Toolkit (see site http://template-toolkit.org). It has scripts to allow whole websites to be built with the invocation of a single script. You could also build your templates for the dynamic content at the same time, just leaving the dynamic content for fill-in later. You could then have a run-mode that serves each static page based on some cgi parameter(s). Sean On Oct 6, 2004, at 10:09 PM, Joel Gwynn wrote: I'm working on a web site that will be a combination of static pages and application pages, and I'd like to use cgiapp to build the static pages. I've been browsing the archives, and can't find any real answers. Should I be considering a separate utility or CMS based on HTML::Template? - Web Archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ http://marc.theaimsgroup.com/?l=cgiappr=1w=2 To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Web Archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ http://marc.theaimsgroup.com/?l=cgiappr=1w=2 To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [cgiapp] Hybrid static/dynamic site
Joel, You might also look at using Template Toolkit (see site http://template-toolkit.org). It has scripts to allow whole websites to be built with the invocation of a single script. My favourite static renderer at the moment is HTML::Webmake. http://webmake.taint.org/ It can also build/refresh whole sites from a single script. Thilo - Web Archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ http://marc.theaimsgroup.com/?l=cgiappr=1w=2 To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [cgiapp] Hybrid static/dynamic site
(Sorry for that message with nothing new in it. Need more coffee.) If you're ok with going the somewhat commercial route I've used Movable Type in this scenario which is for all intents and purposes a CMS. Its template engine is not optimized for dynamic generation though. It does use HTML::Template for its own application templates. With the smart use of includes and a shared stylesheet it can be pretty seamless. tim/ On Oct 6, 2004, at 10:09 PM, Joel Gwynn wrote: I'm working on a web site that will be a combination of static pages and application pages, and I'd like to use cgiapp to build the static pages. I've been browsing the archives, and can't find any real answers. Should I be considering a separate utility or CMS based on HTML::Template? - Web Archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ http://marc.theaimsgroup.com/?l=cgiappr=1w=2 To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [cgiapp] Hybrid static/dynamic site
Hi Joel -- I'm working on a web site that will be a combination of static pages and application pages, and I'd like to use cgiapp to build the static pages. I've been browsing the archives, and can't find any real answers. Should I be considering a separate utility or CMS based on HTML::Template? Stepping back a bit: Why do you want CGI-App to build static pages? Possible reasons that come to my mind: * You're trying to implement site-wide login security. * You have global parts (navigation, etc.) which you want included in each page. In the first case, if you have the means I would strongly recommend you use an Apache module-based auth system, instead of putting your security into your application. This will protect all documents, othogonally to the content served. In the second case, you could use simple server-side includes. However, I can see the benefit of using one template system throughout. If this is your goal, then this isn't really a CGI-App question so much as a question for your templating system. If you're using HTML::Template (the default template engine for CGI-App) I would recommend writing an Apache module which handles any file in htdocs which ends .tmpl. If you do not have the means to write an Apache module, that is when you need a script to drive your template engine. Some other people have referred to such a script for Template-Toolkit. I've never seen it before, but writing such a script for HTML::Template should be trivial. You could use CGI::Application, or you could do something even more low-level. All the script has to do is to is to look at the requested URI, load the appropriate template file, and populate it with the appropriate data. TTYL, -Jesse-
RE: [cgiapp] Hybrid static/dynamic site
Hi Tim, Joel -- If you're ok with going the somewhat commercial route I've used Movable Type in this scenario which is for all intents and purposes a CMS. Its template engine is not optimized for dynamic generation though. It does use HTML::Template for its own application templates. With the smart use of includes and a shared stylesheet it can be pretty seamless. I hadn't through that Joel would want to statically render the site. (I got the impression from his original message that he didn't want to serve static pages.) If he doesn't mind statically rendering pages, but just needs a dynamic way to do so, then MT would work. If your content management needs are more sophisticated, you could also use Krang: http://krang.sourceforge.net/ It's free (as in freedom, AND beer), all Perl, uses HTML::Template, and was written in part by a few people who are regulars on this list. ;-) TTYL, -Jesse-
Re: [cgiapp] Hybrid static/dynamic site
What we did recently for just such a project was install the krang cms (written by sam tregar (HTML::Template) and jesse erlbaum (CGI::Application) just to name a few) to let the content people manage the static pages. It generates the static pages from templates and element classes that write. Then the dynamic portion was written using C::A. To merge the two (ie, login/logout buttons on static pages, etc) we used some SSI that we wrote as mod_perl handlers. I think overall it came together rather nicely. Joel Gwynn wrote: I'm working on a web site that will be a combination of static pages and application pages, and I'd like to use cgiapp to build the static pages. I've been browsing the archives, and can't find any real answers. Should I be considering a separate utility or CMS based on HTML::Template? - Web Archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ http://marc.theaimsgroup.com/?l=cgiappr=1w=2 To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Michael Peters Developer Plus Three, LP - Web Archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ http://marc.theaimsgroup.com/?l=cgiappr=1w=2 To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [cgiapp] Hybrid static/dynamic site
So Krang will use the same set of templates as my cgi-app? Michael wrote: What we did recently for just such a project was install the krang cms (written by sam tregar (HTML::Template) and jesse erlbaum (CGI::Application) just to name a few) to let the content people manage the static pages. It generates the static pages from templates and element classes that write. Then the dynamic portion was written using C::A. To merge the two (ie, login/logout buttons on static pages, etc) we used some SSI that we wrote as mod_perl handlers. I think overall it came together rather nicely. Joel Gwynn wrote: I'm working on a web site that will be a combination of static pages and application pages, and I'd like to use cgiapp to build the static pages. I've been browsing the archives, and can't find any real answers. Should I be considering a separate utility or CMS based on HTML::Template? - Web Archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ http://marc.theaimsgroup.com/?l=cgiappr=1w=2 To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Web Archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ http://marc.theaimsgroup.com/?l=cgiappr=1w=2 To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [cgiapp] Hybrid static/dynamic site
Joel Gwynn wrote: So Krang will use the same set of templates as my cgi-app? Well, this is what we did... Sorry if someof this doesn't make sense as I will be talking some krang specific stuff. The navigation on the home page is built dynamically at publish time, but served to the users as a static page. We wanted the dynamic section to have the same nav, etc from the home page no matter what the people using the cms decided to do with the content. Krang has a category template that is used to place the individual stories into (providing, common header, footer, nav). So we added something to the publish of the home page so that when it fills in the template to create the home page it also splits the result into two templates (header.tmpl and footer.tmpl) which are then placed in the site tree. The templates of our dynamic site all tmpl_include header.tmpl and tmpl_include footer.tmpl so that they look exactly the same as the home page (with regard to nav, etc). Since the krang publish root is different than the template root for our dynamic section, we have to tell our C::A based apps to have multiple values in TMPL_PATH. (Which is why I provided that patch just a few weeks ago). Does that make sense? It's really nice since the publish generates our common templates that the dynamic site uses. And we never have to worry about keeping them in sync. HTH Michael wrote: What we did recently for just such a project was install the krang cms (written by sam tregar (HTML::Template) and jesse erlbaum (CGI::Application) just to name a few) to let the content people manage the static pages. It generates the static pages from templates and element classes that write. Then the dynamic portion was written using C::A. To merge the two (ie, login/logout buttons on static pages, etc) we used some SSI that we wrote as mod_perl handlers. I think overall it came together rather nicely. Joel Gwynn wrote: I'm working on a web site that will be a combination of static pages and application pages, and I'd like to use cgiapp to build the static pages. I've been browsing the archives, and can't find any real answers. Should I be considering a separate utility or CMS based on HTML::Template? - Web Archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ http://marc.theaimsgroup.com/?l=cgiappr=1w=2 To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Michael Peters Developer Plus Three, LP - Web Archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ http://marc.theaimsgroup.com/?l=cgiappr=1w=2 To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [cgiapp] Hybrid static/dynamic site
On Oct 7, 2004, at 9:26 AM, Joel Gwynn wrote: or just write a simple script using lwp-simple to call the cgi-app to render each static page and I'll save it with a different name.. That's probably not necessary unless the data is being remotely hosted like a syndication feed would. When I've used HTML::Template for lo-fi static publishing (ala Blosxom) I just traversed a directory of data files and using either regex of File::Spec created an associated HTML file that I would dump the output. Everything was local and didn't require a web server hit. tim/ - Web Archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ http://marc.theaimsgroup.com/?l=cgiappr=1w=2 To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[cgiapp] Re: Hybrid static/dynamic site
On 2004-10-07, Joel Gwynn [EMAIL PROTECTED] wrote: I'm working on a web site that will be a combination of static pages and application pages, and I'd like to use cgiapp to build the static pages. I've been browsing the archives, and can't find any real answers. Should I be considering a separate utility or CMS based on HTML::Template? When I wrote Cascade: http://www.summersault.com/software/cascade/ I wanted many run modes to work as dynamic pages or static pages. Depending on which mode the system was working in, generated links might look like /Topics/Skateboarding/index.html or /cgi-bin/sk8.cgi/category_page?category_id=23 CGI::Application works well in this problem space because it keeps the page content separate from the headers that need to be sent from the browser. The basic of printing a static page from CGI::App is easy: sub write_static_pages { my $self = shift; use File::Slurp; write_file('my_file.html',$self-my_runmode); # ... } Mark -- http://mark.stosberg.com/ - Web Archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ http://marc.theaimsgroup.com/?l=cgiappr=1w=2 To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]