Soren Roug writes:
 > Hello,
 > I'm trying to call a method inside a folder that uses this common way of
 > listing its content:
 > <dtml-in "PARENTS[0].objectValues('File')">
 > <dtml-var absolute_url><br>
 > </dtml-in>
 > Let's call this folder FileLibrary. (It's actually a Z Class subclassed
 > from ObjectManager)
 > My problem is when I call the method from the folder above, then PARENTS
 > is unchanged and the script will try to enumerate the files in the
 > folder I'm calling from. I've tried several things, e.g.
 > ...
 > <dtml-with FileLibrary>
 > <dtml-call "REQUEST.PARENTS.append(_)">...

   <dtml-call "REQUEST.PARENTS.append(FileLibrary)">

would do it, but would be *VERY* hacky code.

   Give your method a parameter, say "sourcefolder".
   In your method:

      <dtml_in "(_.has_key('sourcefolder') and sourcefolder or 
   (You may want to factor the "(_.has_key....PARENT[0])" out.)

   Then, when your method should use a special folder, use:

         <dtml-let sourcefolder=whatever>
           <dtml-var FileLibrary>


Zope maillist  -  [EMAIL PROTECTED]
**   No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to