[Zope] - Yet another stupid question: image folders

Jim Fulton jim@Digicool.com
Wed, 09 Dec 1998 00:35:34 +0000


"Christopher G. Petrilli" wrote:
> 
> So I was sitting and breaking things last night (between the shower
> thoughts on FTp access, etc), and tried what seemed obvious to me, which
> is probably totally wrong given my inexperience with BoboPOS, but...
> 
> What I want to be able to do is have a folder that contains images as a
> subfolder to my current folder.  Now I know I can reference them, no
> problem: <!--#var "images.logo"-->  but that doesn't give the right SRC=
> line in the IMG directive.  Now I sat and thought about this, but I'm
> just not sure how an image is supposed to find itself in the hierarchy
> so it can publish the right URL to find itself.
> 
> A simple solution would be for it to find itself and publish an absolute
> location, rather than relative (as it currently does), but that means it
> has to know wher eti is...

I'm going to try to respond to the entire thread at once by simply stating
my position on how this should work.  Here goes:

1. Images, and perhaps all objects, should have a method named something
   like absoluteURL, that returns some kind of absolute URL.

   Franky, I'm not sure how this will work, but your comments have convinced
   me that it should work. Note that it may only work in the context of a 
   web request.  

   Note that objects will not store their URL because an object
   may be referenced from many places and therefore may have more 
   than one URL.  The value returned from absoluteURL will likely
   take into account the way the object was accessed.  (There will
   likely be lots of magic involved; best not think too hard 
   about it or keep the glue gun handy. ;)

2. The str for an image will use absoluteURL and will use size 
   methods too, if there every are any.

3. There may be lots of other image methods that could be used
   with fmt, as in:

   <!--#var "images.logo" fmt="relative"-->

Jim

--
Jim Fulton           mailto:jim@digicool.com
Technical Director   (540) 371-6909              Python Powered!
Digital Creations    http://www.digicool.com     http://www.python.org

Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
address may not be added to any commercial mail list with out my
permission.  Violation of my privacy with advertising or SPAM will
result in a suit for a MINIMUM of $500 damages/incident, $1500 for
repeats.