On Thu, 27 Jun 2002, e.sammer wrote:

[ ... ]

> I'm a recent convert from another template module mostly for the include 
> behavior of TT. What I'd like to do is have generic "components" similar 
> to slashdot's login, poll, etc. included in a large number of pages. 
> I'll use a login component as an example from here on, but substitute as 
> needed.
> 
> 1. Use something like TT's plugin method. The problem here is that way 
> too much logic would wind up in a template (too much "C" in the "V")

I don't see a problem with using TT's Plugin feature; not even the one you
mention. You can put virtually all of your logic in a pure perl module and
keep it out of the template.

On http://www.ladyraquel.com I have a navigation menu that is a
'component' as you mention. It's dynamically created on each request,
using the request URI to draw the menu (exanding and closing 'sections'
based on whether you are 'in' the 'section', etc.). But the code in the
template(s) is very simple:

in a page to be processed by TT:
================================

[% INCLUDE header.tmpl %]
<P>Yada yada</P>


in header.tmpl:
===============

[% USE Menu(MENU, APACHE_REQ) %]
<HTML>
  <BODY>
    [% Menu.build %]



As far as ease of implementation in the template, I think this approach is
the way to go.

HTH

- nick

~~~~~~~~~~~~~~~~~~~~  
Nick Tonkin   {|8^)>




Reply via email to