[% FOREACH section IN
         [ 'Home', 'Trees', 'Advice', 'Our_Forests', 'Links' ]
%]
            <td style="width: 15%;">
    [% IF $template.name.search($section) %]
               <b><i>$section</i></b>
    [% ELSE %]
               <a href="../$section/Welcome.html">$section</a></td>
    [% END %]
               Debug: section is $section template is $template.name
[% END %]

The IF clause never evaluates as true.

Running this, the out put of the debug section is:

Debug: section is Home template is Home/Welcome.tt2
Debug: section is Trees template is Home/Welcome.tt2
Debug: section is Advice template is Home/Welcome.tt2
Debug: section is Our_Forests template is Home/Welcome.tt2
Debug: section is Links template is Home/Welcome.tt2

Some wretched piece of syntax I'm missing, no doubt.

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

Reply via email to