I am using Template 2.12. Please, tell me my misusing this library on the following points:

1) The following statement (which seems to be valid for me) caused an error ("norder" and 
"order"
are variables):

[% norder = -order %]

Log trace:
stderr: From $template{ru}: file error - parse error - 
tables/headers/om_link_view.html.tmpl line 6:
unexpected token (-)
stderr:   [% norder = -order %]

Well, solution, which works ok is:

[% norder = 0-order %]


2) Concider the following statements:


[% dir = 'asc' %]
...
[% dir = 'desc' IF norder > 0 %]

which generates the following temaplate:

$stash->set('dir',
  do {
    my $output = '';
    if ($stash->get('norder') > 0) {
       $output .=  'desc';
    }

    $output;
});

From the template we see, that if "norder" is <= 0, then "dir" will be set to "", 
which the given
sequence if statements does not assume ("dir" should be "asc").

Thanks a lot.

Bye.



_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to