On 17/12/12 10:49, Dave Howorth wrote:
Michael Friendly wrote:
This is my first attempt to use the Template system & tpage to refactor
some old
web pages to make them more flexible for further development.
The web page I'm working on is at
http://www.datavis.ca/gallery/missed.php
and I simply want to generate each of the table rows from a template
file, that looks like that below.

There's probably something very basic I'm missing, but the lines
[% FOREACH item IN items %]
     [% INCLUDE item %]
[% END %]
produce no output in the tpage generated file.
It's a little awkward to answer clearly without running the risk of
offending you, so please don't take offence ...

The big question and the most likely reason you're not seeing anything
is that your items do not contain what TT expects.

I think the issue here is just the missing $ in the INCLUDE directive:

[% FOREACH item IN items %]
    [% INCLUDE item %]
[% END %]

should be:

[% FOREACH item IN items %]
    [% INCLUDE $item %]
[% END %]


otherwise it'll look for the block/file called "item".

cheers,

Tom


_______________________________________________
templates mailing list
templates@template-toolkit.org
http://mail.template-toolkit.org/mailman/listinfo/templates

Reply via email to