[Zope-dev] Reference files in a product folder

Chris McDonough chrism@digicool.com
Sat, 22 Apr 2000 14:39:01 -0400 (EDT)


You're going to have to acquire the image objects from within an
instance of the 'main' ZClass to get a working URL to
them.

So in a DTML document within an instance of zclass 'main' called
'maininstance':

<dtml-var "myimagename.absolute_url()">

will work.

You can;t just go grab these things' URLs right out of the Product by
traversing the Control_Panel.Products.ProductName.ZClassName.ImageName and
calling absolute_url on that.  The reason is that though images are
capable of being placed in a zclass, they are not really methods, and as
such, the returned absolute_url from this traversal is wrong (it omits an
intermediate 'propertysheets' path member).  You *can* use handwritten
HTML to go grab the image like:

<img
src="Control_Panel/Products/LotsOfImages/main/propertysheets/methods/myimagename">

But you can;'t programatically generate this string using absolute_url().

This *might* be considered a bug
if we were sure that we really, truly wanted to allow images to be methods
of zclasses.  But I think for now it's one of those grey areas.

On Sat, 22 Apr 2000, Morten W. Petersen wrote:

> How do I do that? =]
> 
> Example:
> 
> 	Product LotsOfImages has 50 images within it's main ZClass, main;
> 	How do you get the URL of the images from within a DTML Document,
> 	in main?
> 
> -Morten
> 
> 
> 
> _______________________________________________
> Zope-Dev maillist  -  Zope-Dev@zope.org
> http://lists.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope )
>