Re: [Templates] object-oriented templates, inheritance, references to blocks : HOWT O ?

[prev] [thread] [next] [Date index for 2004/04/27]

From: Perrin Harkins
Subject: Re: [Templates] object-oriented templates, inheritance, references to blocks : HOWT O ?
Date: 21:56 on 27 Apr 2004
On Tue, 2004-04-27 at 12:21, Dami Laurent (PJ) wrote:
> It seems that plain inclusion of block components does not fit here,
> so I'm trying to design the template collection in an object-oriented
> way.

FWIW, the common way to add inheritance to your templates is to make
them separate files, not blocks, and vary the include path.  This allows
you to have a directory setup like this:

base/
base/style1/
base/style2/

Then set your include path to search depth-first from your selected
style directory so that a "PROCESS foo.tt" will look for foo.tt in
style2 and then in base if it doesn't find it in style2.

- Perrin


_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates

Re: [Templates] object-oriented templates, inheritance, references to blocks : HOWT O ?
Perrin Harkins 21:56 on 27 Apr 2004

Generated at 08:56 on 15 Mar 2005 by mariachi v0.52