[Templates] Hello all

Bill Moseley moseley at hank.org
Mon May 19 04:59:44 BST 2008


On Sun, May 18, 2008 at 10:12:24PM -0400, Kelly Thompson wrote:
> 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>');
> %]

Think you might need a block there:

    MACRO unescape( text ) BLOCK;
        ...
        ...
    END;

Other examples at the end of this section:


http://tt2.org/docs/manual/Directives.html#section_Filters_Plugins_Macros_and_Perl



-- 
Bill Moseley
moseley at hank.org




More information about the templates mailing list