> A String widget/template allows you to control the rendering of all
> fonts dynamically.  If the String widget/template sees the incoming
> request is from IE5+, it doesn't render the font if the font is the
> same as the default font.  The Style widget/template renders the
> default font in a style if the browser is IE5+.  This avoids the
> stylesheet bugs in all other browsers and gives 90% of your users who
> are running IE5+ a much lighter weight page.
>
> It's cumbersome to do wrap all text in string templates, because the
> calling mechanism is verbose.  Most template languages I've looked at
> only support named parameters.
>
> Widgets can have named parameters, e.g.
>
>     String({
>         value => ['User.first_name'],
> string_font => 'my_first_name_font',
>     });
>
> but it is much more convenient to use positional notation:
>
>     String(['User.first_name'], 'my_first_name_font');

You can actually do that pretty comfortably with Template Toolkit.  You
could use a filter for example, which might look like this:

[% FILTER font('my_first_name_font') %]
... some text, possibly with other template directives in it...
[% END %]

The filter is a module which would get to post-process the output of the
contained block.

I believe the taglibs in AxKit could be used in a similar way.

- Perrin

Reply via email to