[Zope3-Users] Acess view class method of foreign object

Florian Lindner mailinglists at xgm.de
Tue Feb 22 11:45:47 EST 2005


Am Dienstag, 22. Februar 2005 13:28 schrieb Dominik Huber:
> Florian Lindner wrote:
> >Hello,
> >I iterate though all items of a folderish object in its view:
> >
> ><div tal:repeat="item context/values">
> > Desc: <span tal:replace="item/view/getShortDescription">Desc</span><br />
> ></div>
> >
> >The above sippet does not work.
> >
> >getShortDescription is a object of the view class of the contained object
> >type. In views of this object it would be accessed with
> >view/getShortDescription. How can I access it from another view?
>
>  item/@@subview/getShortDescription
>
> where subview ist the name registered within ZCML.
>
> for example:
> item/@@absolute_url/breadcrumbs

Sorry, I meant

> >getShortDescription is a _method_ of the view class of the contained object

Mmmh, I tried tal:replace="item/@@link.html/getShortDescription"

but it does not work.

The view is registered with:

    <page
        name="link.html"
        for="CS.Linklist.interfaces.ILink"
        class=".link.Link"
        template="link.pt"
        permission="zope.View"
        layer="centershock" 
    />

getShortDescription is a method of .link.Link.

And I want to access the method from a view on ILinklist. 

Thanks,

Florian


More information about the Zope3-users mailing list