|
Date: 5/5/2008 11:22 am · Subject: Re: if/unless/then/else regex in templates · Rating: 0
You are right. It does, however, support custom subroutines. It seems kludgey, but this is the work around I ended up using:
In the Apache startup.pl script:
HTML::Template::Expr->register_function( ereg => sub { my $one = shift; my $two = shift; return 1 if $one =~ m/$two/; return 0; });
In the navigation template:
<tmpl_if expr="ereg(currentPage_url, 'about')">
YES!
</tmpl_if>
I think I'll submit a feature request for WebGUI to support the HTML::Template::Pro template engine, which would be a more elegant solution.
--- (Edited on 5/5/2008 11:22 am [GMT-0500] by aaronp55426) ---
|