On Tue, 9 Apr 2002, Simon McGregor wrote:

> I am interested in the feasibility of
> grafting our syntax onto the TT engine and making it publicly
> available.

The difficulty of migrating from an existing template system depends on
how complicated your existing template code is.

Things to remember:

  - Template toolkit processing directives are not perl.  But you can
    configure TT to use perl with the EVAL_PERL option.

  - TT can use inline '$vars'.  For example

      Hello $foo, welcome to our web page

    See the INTERPOLATE option.

  - TT can use different tags.  If [% %] isn't to your liking then use
    other tags.  See the TAG_STYLE option.

  - TT filters (with the latest version of TT) are really easy to
    write.  Maybe you could write a module

     package Template::Plugin::OldTemplateSystem;
     use base qw(Template::Plugin::Filter);

     sub filter
     {
        my $self = shift;
        my $text = shift;

        ... process text though your old template system ...

        return $text;
     }

     ... and then in TT (after USEing the module) ...

     [% FILTER OldTemplateSystem %]
       ... your old template code ...
     [% END %]

   - Maybe you can write something that allows you to use your
     existing template system to create TT templates.

Hope that's of some help.

Mark.

-- 
  Mark Fowler
  Technology Developer
  http://www.indicosoftware.com/




Reply via email to