At our site, we use CGI::Application and Template::Toolkit to create a
serious of tools.  CGI::App means that we create an Application module,
which is used by various instance scripts (which set certain params).
The module will give the output of various templates.  This gives us
wonderful level of code reuse.

What I'd like to do is get wonderful levels of template reuse.  Because
we'll have different instances of the same modules, I'd like to be able
to point the module to a directory for templates, and have every
PROCESS-like calls that start at the directory, and 'fall' upward to the
template root (we don't allow absolute paths).   Thus we can define a
directory and store the various templates for the default tool there,
and create subdirs of more specific applications of the tool.  Any case
where the specific application doesn't have a template defined will
default to the more generic version.

So I'm looking at the best way to approach this.  I'd like to not use a
Plugin -- the USE calls will just add complexity to an approach that I'm
trying to make more simple.  I've looked into defining a subroutine
that's passed to the template call, but a  PROCESS Cascade('some_path')
call treated Cascade as a filename rather than a subroutine call.  I
could try to write the subroutine to do the actual inclusion, but that
gets messy (I need to process the named file, and I don't want to run
through all the header/footer overhead again).  If there's a way to
avoid that, that seems the best option, so I can just call
Cascade('some path')  in place of PROCESS.

Can I do what I seek, or am I headed in a wrong path?  Which of the many
M's should I check to RTFM?

Thanks in advance.

-- 
SwiftOne
[EMAIL PROTECTED]



_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to