[Zope] Method Context Control

Pavlos Christoforou pavlos@gaaros.msrc.sunysb.edu
Tue, 2 Feb 1999 16:18:59 -0500 (EST)


On Tue, 2 Feb 1999, Michael Bernstein wrote:
> If this is not currently possible, I would like to suggest that a
> 'context' attribute be added to <!-- #var -->, with the default being
> 'context=here' (the current behaviour) and an additional value of
> 'context=self' or perhaps 'context=origin' being made available.
> 
> Another possible value for a 'context' attribute might be
> 'context=parent' to move the context up one level in the hierarchy.

Lets suppose we have a document in the top level object named global_map
with an entry like:

<A HREF="<!--# var title-->"><!--# var title--></A>
<A HREF="<!--# var BASE1--><!--# var title-->"><!--# var title--></A>
 
How should the relative URL's or BASE variables be handled if this
document is called from a subobject down the
object hierarchy like <!--# var global_map context=origin--> ?

Anyway if you do need to access the parent of a given object you can use:
<!--# var "aq_parent.<whatever method you want to call>"-->

but I think one must be careful then of relative URLS.

For more info read Zope/lib/Components/ExtensionClass/Acquisition.stx in
the Zope distribution. 


Pavlos