While this doesn't really answer your question, you could also just use
the __first__, __last__,__inner__ and __odd__ loop_context_var to
alternate table row colors in a <TMPL_LOOP>. Sumpin' like:
It's (pretty much) in the docs. I guess I don't really "get" what
you're looking for and how it would be useful to generalize
On Wed, 2002-10-09 at 12:55, Michael Raidel wrote:
> Hi all,
> I like the clean design of HTML::Template very much.. That it is
> possible to install it on a webhost easily is also an advantage over,
> for example, Template Toolkit. Nevertheless I would be interested in the
> ability to put functions or classes as content in a variable, like it's
> possible in the Template-Toolkit. IMO this would be fully compatible to
> the approach of not mixing programming and content, content-designers
> doesn't even need to know, that the variable they are using isn't a
> scalar or an array!
> In my opinion there are often problems in using Templates, which only
> can be solved by such an approach. An Example: If I want a table with
> alternating table-row colors, I can simply write a class which returns
> one color after the other when it's called by the template. And I simply
> can use one instance for each table-column! So it's also possible to
> delete or add rows without affecting the alternating colors... I can't
> imagine such a simple solution without this approach.
> Maybe someone knows the internals of HTML::Template good enough to
> evaluate if this would be easy to implement..
> Thanks, Michael
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> Html-template-users mailing list
Dan Collis Puro
GeekUprising Internet Consultants