container and context for folderish objects
I created a very simple folderish product. Everything works fine. But I was surprised that "context" and "container" seem to behave differently for folderish object than for normal Folder. Here's the problem: my product's instance "a" contains a DTML Document "doc" and some photos "img1", "img2". A simple ZPT "lst" queries object ids: <p><li tal:repeat="item python:here.objectIds()" tal:content="item"></p> <p><li tal:repeat="item python:container.objectIds()" tal:content="item"></p> I need to call this ZPT as follows: /a/doc/lst and I expect to get a list of objects contained in "a". The problem is that lst does not provide that. The first line shows nothing, and the second line shows content of the parent Folder! I would have expected that "container" is the "a", the folderish object. Why does it not work? I \know that I can get my list by calling /a/lst, but unfortunately I cannot do that. -- Milos Prudek
Milos Prudek wrote:
I created a very simple folderish product. Everything works fine. But I was surprised that "context" and "container" seem to behave differently for folderish object than for normal Folder.
To answer my own question: I misunderstood what container does. Desired behaviour can be obtained via <p><li tal:repeat="item python:here.aq_parent.objectIds()" tal:content="item"></p> -- Milos Prudek http://www.spoxdesign.com - your web usability testing
participants (1)
-
Milos Prudek