[ZPT] Folder - index_html
Charlie Clark
charlie at begeistert.org
Mon Aug 11 13:57:17 EDT 2003
On 2003-08-10 at 15:44:41 [+0200], Simon Faulkner wrote:
> It needs to list the Depots (sub folders) if it is a Country folder
> (first level down) and list the orders in the folder if it id a Depot
> (2nd level down)
>
> Any pointers as to a good way of telling how far down the tree we are?
>
> There is no else so do I just have to condition statements?
>
> Am I barking up completely the wrong tree in my approach!?!
wow. This isn't really much of a ZPT issue, I think, apart perhaps from the
use of conditions.
It sounds to me like the kind of hardwiring you're doing is likely to cause
problems: what you're wanting to do isn't exactly that simple.
Dieter has already illustrated how you use objectValues() to list folder
contents. But the kind of complexity you want will need some kind of
PythonScript which will use objectValues() recursively if required. You
should not need to include index_html's in the various folders which need
acquisition since index_html will be acquired anyway.
In order to tell how far down the tree you are you can always look at the
path and count it yourself but again this kind of hardwiring might not be
what you want.
I suspect you might be better using a ZCatalog to search for you and
writing a few scripts to do the additional user-relevant logic.
Charlie
More information about the ZPT
mailing list