Thargor has asked for the wisdom of the Perl Monks concerning the following question:

Ok I have just finished my first web app. it isn't anything complex a grand total of 4 templates. I was wanting to know how to take the common links that each has to the other and put them in a header to sort of clean up the templates. Thanks

Replies are listed 'Best First'.
Re: Headers in Template Toolkit
by gellyfish (Monsignor) on Mar 03, 2005 at 15:18 UTC

    I think you are looking for [% INCLUDE "whatever.tt" %]

    /J\

      There are actually 3 ways to do this
      1) [% INSERT "whatever.txt" %]
      Inserts the contents of whatever.txt without doing any template substitutions on it
      2) [% INCLUDE "whatever.tt" %]
      This processes the template and inserts it. Variables are localized (i.e. changes to variables in whatever.tt are not reflected in the parent template)
      3) [% PROCESS "whatever.tt" %]
      Same as above but variables are not localized. (i.e. changes to varibles in whatever.tt are reflected in the parent template)

      More information can be found here here

      Hey thanks I didn't realize it was that simple. It sure cleans up the templates though :)