1. RE: Dynamic generation - yes, that's certainly one option I'm considering. I like the idea of pre-generation of static html pages for the clarity, the server load. But this requirement for authors to launch a generation routine each time they make a change is a stumbling block. One possible compromise would be a secure author's control panel page with a "Generate!" button that launches a cgi script to do all the work. It's not bad.

2. RE: ttree recursion vs. content recursion - From the tutorial suggested above, I note: DYNAMIC CONTENT GENERATION VIA CGI SCRIPT

#!/usr/bin/perl -w use strict; use Template; my $file = 'src/greeting.html'; my $vars = { message => "Hello World\n" }; my $template = Template->new(); $template->process($file, $vars) || die "Template process failed: ", $template->error(), "\n";
Which I believe implies that although TT has ttree to automatically drill down through a hierarchy to find and process a whack of templates, if I have only one template and a whack of content files, I have to do the recursion work myself. To my mind, this seems a little backwards, since a large template-driven site is rarely going to be the first case, and much more commonly going to be the second case. No?

So, OK, I make my template with the appropriate INCLUDES, etc. Then I have to write a script that travels my website structure looking for content files (probably designated by an extension), and merging them with the template. To be honest, I could have done that myself with a couple of custom markers in the html files and a little routine to scour the pages for the markers, parse out the tag and shunt to a corresponding insertion routine. But I guess the moduloe has the advantage of lots of other functionality for the future...




Forget that fear of gravity,
Get a little savagery in your life.

In reply to Re: Learning Template::Toolkit - have I understood? by punch_card_don
in thread Learning Template::Toolkit - have I understood? by punch_card_don

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.