I've got viewlets working fine (really cool too!) but I'm stumped on getting a
CSSViewlet declared.  Googling doesn't show anyone using CSSViewlets but
hopefully someone who implemented it might clarify.

The doc files show how to do it with pure Python and the utility function
viewlet.viewlet.CSSViewlet but I need it using ZCML.  I'm trying:


This bypasses the utility function and generates an error about there being no
 'index' attribute, which is the small template file containing the
parameterized HTML link tag, in the result class.

So I give it a template file, although I really hate putting such a full path
in my component ZCML file:


And now it errors out about a missing '_path' class attribute, which is passed
into the utility function.

I've also thought about passing in the utility function via a 'factory='
parameter but the viewlet directive doesn't support such a parameter.  And
I've tried just passing in the utility function on a 'class=' parameter,
figuring maybe it just wants a callable.  No luck, it wants a real class to
pass into type() for instantiation.

It's only seven lines of ZCML but I sure can't see how to use it properly.
Next I'll just roll my own ZCML directive but it seems there ought to be a way
to use CSSViewlet as intended and I'm just missing it.

Help please?

Zope3-users mailing list

Reply via email to