[Templates] IF a ELSE b END always produces b

[prev] [thread] [next] [Date index for 2004/07/16]

From: Garry Heaton
Subject: [Templates] IF a ELSE b END always produces b
Date: 00:26 on 16 Jul 2004
I can't seem to get an IF ELSE END branch to do the right thing. Following
the lead in the O'Reilly book, I have a site defined by:
layout with:

[% WRAPPER html;
     WRAPPER layout;
       content;
     END;
   END
%]

lib/layout has:

<table>
  <tr>
    <td>[% IF ins %][% ins %][% ELSE %][% PROCESS leftcol %][% END %]</td>
    <td>[% content %]</td>
    <td><!-- rightcol --></td>
  </tr>
</table>

The template has a BLOCK and some content:

[% BLOCK ins %]Left column content[% END %]
Main content ......

The problem is that the IF branch always processes 'leftcol', never 'ins'.
I've tried [% PROCESS ins %] as well but no luck.

Garry Heaton



_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates

[Templates] IF a ELSE b END always produces b
Garry Heaton 00:26 on 16 Jul 2004

Re: [Templates] IF a ELSE b END always produces b
merlyn (Randal L. Schwartz) 01:29 on 16 Jul 2004

Generated at 08:56 on 15 Mar 2005 by mariachi v0.52