[Zope3-Users] z3c.macro

Mikael Moutakis mikaelmoutakis at gmail.com
Sun Aug 5 18:20:08 EDT 2007


Hello
I'm new to Zope 3, and I'm trying out z3c.macro. I can't seem to get my
macro to work with a view class instead of just a page template

I've registered the macro

    <z3c:macro
      template="template.pt"
      name="my_macro"
      view=".classes.MyClass"
    />


My view

class MyClass:
    def MyFunction(self):
        #do something



My page template

<metal:block define-macro="my_macro">
  My text
  <div tal:content="view/MyFunction" />
      some text again
  </div>
</metal:block>


Unfortunately, I get a component lookup error. Am I using the wrong method
to create the view class?

Regards,

Mikael M
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope3-users/attachments/20070806/ec704bad/attachment.htm


More information about the Zope3-users mailing list