[Zope3-dev] "here" vs "context" for templates in content space

Jeffrey P Shell jeffrey@cuemedia.com
Fri, 28 Feb 2003 16:42:11 -0700


On Friday, February 28, 2003, at 02:52  PM, Jim Fulton wrote:

> Jim Fulton wrote:
>> Templates used for views have a context variable for refering to
>> the context of the view, the thing being viewed.
>> Templated pages, which are templates used in content space, like
>> traditional zpt templates, have a "context" variable for refering to
>> the folder containing the template.
>> We decided to use "context" in both cases, but the meaning of 
>> "context"
>> is a little different in the two cases. I wonder if it would be better
>> to use "here" to make things more familiar for Zope 2 users?
>
> As many pointed out, "container" would be more correct than "here".
> I wonder if anybody uses "container" in Zope 2.

I thought the definition is (in Zope 2) thus:

container - thing holding the script/page/whatever
context - where it was being called  (aka wrapped_self)

here - same as context

If `here` were to suddenly change to `container`, it would be like 
changing the traditional meaning of `self` to mean `super`.

I don't know why we'd change the behavior of 'content-space' pages.  
This whole 'context means context except for where it means container' 
begs the question - why not just keep context meaning context and have 
container mean container?


I use 'container' heavily in both scripts and templates in Zope 2, and 
also 'here / context', with conscious reasoning behind each use.