[Zope-CMF] problem creating Five views for CMF

Jens Vagelpohl jens at dataflake.org
Wed Oct 12 17:21:02 EDT 2005


So I've dabbling a little bit hooking up some Five view class code  
Tres gave me so that it actually gets called when viewing the item.  
It seems to be registered the wrong way somehow and I'm getting this  
traceback:

Traceback (innermost last):
   Module ZPublisher.Publish, line 113, in publish
   Module ZPublisher.mapply, line 88, in mapply
   Module ZPublisher.Publish, line 40, in call_object
   Module Products.Five.browser.metaconfigure, line 458, in __call__
AttributeError: index

What I have done so far is this:

- In CMFDefault/configure.zcml I include the "browser" package
- In CMFDefault/browser/configure.zcml I have the following:

------------------------------------------
   <five:traversable class="Products.CMFDefault.Link.Link" />

   <browser:view
       for="Products.CMFDefault.interfaces.ILink"
       name="link_view"
       class=".linkviews.LinkDisplayView"
       permission="zope2.View"
       >

     <browser:page name="index.html"  template="content_view.pt" />

   </browser:view>
-------------------------------------------

The module linkviews.py contains the code from Tres. content_view.pt  
is a page template modelled on the standard CMF link_view.pt.

 From digging in Five/browser/metaconfigure.py the browser:page tag  
should have triggered code that inserts the name "index" on the view  
class. But apparently it didn't :(

Oh, by the way, I have never worked with Five or Zope 3 views before ;)

jens




More information about the Zope-CMF mailing list