Behalf Of Florian Lindner
> Sent: Wednesday, April 06, 2005 11:10 PM
> To: firstname.lastname@example.org; [EMAIL PROTECTED]
> Subject: Re: [Zope3-dev] RE: [Zope3-Users] page uses foreign
> view: contextchanged
> Am Mittwoch, 6. April 2005 17:01 schrieb Roger Ineichen:
> > Hi Florian
> > Behalf Of Florian Lindner
> > > Sent: Wednesday, April 06, 2005 10:22 PM
> > > To: email@example.com
> > > Subject: [Zope3-Users] page uses foreign view: context changed
> > >
> > > Hello,
> > > I'vw a viewA on a objectA including a macro:
> > >
> > >
> > > <metal:block define-macro="info">
> > > <span tal:replace="context/__name__" />
> > > </metal:block>
> > >
> > > A view of objectB uses this macro and inserts it into its
> own viewB:
> > I can't follow. What do you try to say?
> > What is "A view of objectB" and "its own viewB"?
> A object uses a macro which is defined in a view of another object.
> In this macros I want to access the data from the object the view was
> originaly registered for.
Ok, I was thinking about that you mean somthing like this.
This isn't possible. Or let's say you mix up some parts.
The macro which you suggest is just a page template. This template
you are useing in a view. If this macro is also used in another view,
it has in this usecase nothing to do with the other view. There is
no relation, if you register a page template as a macro and a second
time as a view, between the macro and the view.
Perhaps I don't understand this correctly. Can you post the ZCML
directive, then I see what you mean?
> > > <metal:block use-macro="item/@@shortinfo/info" />
> > >
> > > My problem is now, that the context of viewA is objectB. But
> > > I want it to
> > > insert some data from objectA. How can I get objectA, the
> > > object viewA was
> > > registered for?
> > You only can access a view and this view adapts one context.
> > If you have a viewA on objectA and you like to access other
> > context as well there are different concept for this.
> > Take a look at path adapters or pagedata in zope.app.pagelet
> > both of them can be used to access additonal adapters which
> > can lookup for other objects like objectB additional to your
> > request adapter (viewA) on the context (objectA).
> I've read Stephans pagelet demo and I don't think that
> pagelet are the right
> way to solve my problem.
> I will try to take a look at those other methods you mentioned.
> Zope3-dev mailing list
Zope3-dev mailing list