[Templates] Hello all

Kelly Thompson kalexthompson at gmail.com
Mon May 19 03:12:24 BST 2008


I am trying to create a MACRO that will replace a lot of values within a
databased variable.
What I have now is this in my "config" template.

[% MACRO unescape(text)
  text.replace('\r', '<br />');
  text.replace('{b}', '<b>');
  text.replace('{/b}', '</b>');
%]

Then in my "view" template I have:

[% FOREACH item in news %]

[% unescape(item.body) %]

But I get this error:

"Unexpected of of directive in config template line 1-5."


What am I doing wrong?!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.template-toolkit.org/pipermail/templates/attachments/20080518/0e006871/attachment.html 


More information about the templates mailing list