[Zope] conceptual problem with acquisition

Oliver Frommel Oliver Frommel <oliver@aec.at>
Mon, 5 Mar 2001 13:18:32 +0100 (CET)


> 
> /pics/logo.gif
> /dir/subdir1/pics/logo.gif
> /dir/subdir1/index_html (subdir1 is a zclass and index_html a method of it)
> /dir/subdir2/pics/logo.gif
> /dir/subdir2/index_html (subdir2 is a zclass and index_html a method of it)
> /dir/subdir3/pics/   (empty!)
> /dir/subdir3/index_html (subdir3 is a zclass and index_html a method of it)
> 
> ...
> 
> I think it would work if I put the images directly in subdirX and in the
> root dir but this is pretty ugly and should only serve as a last ressort IMHO.
> 
> is there any way / product / trick to make this concept work with subdirs??
>

as a sidenote there's a way I can produce the desired behaviour using a DTML
construct:

in index_html:

      <dtml-call "REQUEST.set('img', 'trans.gif')">
      <dtml-if "_.hasattr(pics, img)">
        <img src="pics/trans_gif" width="10" height="10"></td>
      <dtml-else>
        <img src="dir/pics/trans_gif" width="10" height="10"></td>
      </dtml-if>

but this is ugly and pretty inconvenient to do for every image
and also I am not sure if it works for every conceivable situation.
In general I think my use case is something that can be very useful for many
sites, so I think there should be a generic solution.

--Oliver