Re: [Zope] images in directories
I have a similar situation where I find myself way down in the tree structure and have to go up to a certain point and down again. Leaving "bad structuring" aside (actually its well structured in many other respects), all I could think of to get a hold of these objects was a whole bunch of nested "with" statements. They suck. Now what's with your PathHandler product? How would an appropriate method look like? I was thinking of a "walk2object" method rather than "showImage"... see I don't want to start at "/", I want to start whereever I like at that moment and still take the "/"-separated path info to "walk" to my object. I think this has more to do with elegance than with lazyness. (tho these two know each other very well ;-) ) tia, Danny Dieter Maurer wrote: > > Then Chris Withers wrote: use > > > > I did not believe him and tried it out... > ... it works in Zope 2.2.2. ...worked for me all the way back to 2.1.4 ;-) Anyway, if you're _really_ lazy, write an external method something alogn the lines of: def showImage(self,path): return self.restrictedTraverse(path)(self,self.REQUEST) ...then, in your dtml, you can do: This is all totally untested of course ;-) I've often wondered why this isn't built into DTML so that you could do: obviously, you wouldn't be able to do this with stuf inside " " ;-) cheers, Chris ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] images in directories
Dieter Maurer wrote: > > Then Chris Withers wrote: use > > > > I did not believe him and tried it out... > ... it works in Zope 2.2.2. ...worked for me all the way back to 2.1.4 ;-) Anyway, if you're _really_ lazy, write an external method something alogn the lines of: def showImage(self,path): return self.restrictedTraverse(path)(self,self.REQUEST) ...then, in your dtml, you can do: This is all totally untested of course ;-) I've often wondered why this isn't built into DTML so that you could do: obviously, you wouldn't be able to do this with stuf inside " " ;-) cheers, Chris ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] images in directories
Pete Prodoehl writes: > I was sort of hoping it would be easier. It would be ideal to have this: > > > > boiled down to one simple tag that works when I store images in a subfolder > *and* use file extensions. > > But from what I've read so far, it can't be done... I had this opinion till some days ago. Then Chris Withers wrote: use I did not believe him and tried it out... ... it works in Zope 2.2.2. Dieter ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] images in directories
What's wrong with ? - Original Message - From: "Pete Prodoehl" <[EMAIL PROTECTED]> To: "'zope-list'" <[EMAIL PROTECTED]> Sent: Tuesday, November 07, 2000 2:27 PM Subject: RE: [Zope] images in directories > > I was sort of hoping it would be easier. It would be ideal to have this: > > > > boiled down to one simple tag that works when I store images in a subfolder > *and* use file extensions. > > But from what I've read so far, it can't be done... > > Someone suggested the following: > > > > but that didn't work for some reason, and still seems a little complex for > just inserting an image. > > > Pete > > > > > -- > > Subject: Re: [Zope] images in directories > > > > hi, > > > > Sure they are. If you ftp a jpg to the server it comes up with an id of > > bla.jpg, you can then refrence it in html just like you would on an Apache > > server or whaterver > > > > > > ___ > Zope maillist - [EMAIL PROTECTED] > http://lists.zope.org/mailman/listinfo/zope > ** No cross posts or HTML encoding! ** > (Related lists - > http://lists.zope.org/mailman/listinfo/zope-announce > http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] images in directories
I was sort of hoping it would be easier. It would be ideal to have this: boiled down to one simple tag that works when I store images in a subfolder *and* use file extensions. But from what I've read so far, it can't be done... Someone suggested the following: but that didn't work for some reason, and still seems a little complex for just inserting an image. Pete > -- > Subject: Re: [Zope] images in directories > > hi, > > Sure they are. If you ftp a jpg to the server it comes up with an id of > bla.jpg, you can then refrence it in html just like you would on an Apache > server or whaterver > > ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] images in directories
hi, Sure they are. If you ftp a jpg to the server it comes up with an id of bla.jpg, you can then refrence it in html just like you would on an Apache server or whaterver j. .. . Jason C. Leach ... University College of the Cariboo. .. On Mon, 6 Nov 2000, Chris Withers wrote: > > > Pete Prodoehl wrote: > > > > Is it possible to have an image named "image.gif" or "image.jpg" ? (Are file > > extensions allowed? If so, how are those objects addresses?) > > > > > > or > > > > cheers, > > Chris > > > > > > Pete > > > > > -- > > > > "Farrell, Troy" wrote: > > > > > > > > > > > > > > > > > > > > > > This also works: > > > > > > > > > > > > > > > > ___ > > Zope maillist - [EMAIL PROTECTED] > > http://lists.zope.org/mailman/listinfo/zope > > ** No cross posts or HTML encoding! ** > > (Related lists - > > http://lists.zope.org/mailman/listinfo/zope-announce > > http://lists.zope.org/mailman/listinfo/zope-dev ) > ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] images in directories
Pete Prodoehl wrote: > > Is it possible to have an image named "image.gif" or "image.jpg" ? (Are file > extensions allowed? If so, how are those objects addresses?) or cheers, Chris > > Pete > > > -- > > > "Farrell, Troy" wrote: > > > > > > > > > > > > > > > > This also works: > > > > > > > > > > ___ > Zope maillist - [EMAIL PROTECTED] > http://lists.zope.org/mailman/listinfo/zope > ** No cross posts or HTML encoding! ** > (Related lists - > http://lists.zope.org/mailman/listinfo/zope-announce > http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] images in directories
Pete Prodoehl writes: > Is it possible to have an image named "image.gif" or "image.jpg" ? (Are file > extensions allowed? If so, how are those objects addresses?) It is. And it is quite common. There is a minor problem, if you like to put images in an "image" folder. But this is not related to filename extensions. Dieter ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] images in directories
hi This is a bit of code I was working on, it may not be what you are after but: It scans through a Folder and displays all the images it finds. If that's not what you want, then the last line is probably what you want. With OOP Images know how to display themselves, so all you need to do is call there ID. Also, the PARENTS[0] allows you to go backwards through parent folders 0 is the folder you script is in, 1 is one level back and so on. j. .. . Jason C. Leach ... University College of the Cariboo. .. On 2 Nov 2000, CURTIS David wrote: > Hi, > I check the archives but could not find an answer. How do you display images that >are burried in directories? > For example, > works with the image1 at same level > but > does not. nor does > > Any help would be apprechiated. Thanks in advance > > > > > > > > > > > ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] images in directories
Is it possible to have an image named "image.gif" or "image.jpg" ? (Are file extensions allowed? If so, how are those objects addresses?) Pete > -- > > "Farrell, Troy" wrote: > > > > > > > > > > This also works: > > > > ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] images in directories
> > "Farrell, Troy" wrote: > > > > This also works: Petr van Blokland [EMAIL PROTECTED] ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] images in directories
Aha! Acquisition! http://www.zope.org/Members/Amos/WhatIsAcquisition Assuming that IMAGES is a subfolder of the PWD, try this (untested): Also look here: http://www.zope.org/Members/michel/HowTos/WithTagHow-To Troy What is a fool that has no money? -Original Message- From: CURTIS David [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 02, 2000 9:42 AM To: [EMAIL PROTECTED] Subject: [Zope] images in directories Sensitivity: Personal Hi, I check the archives but could not find an answer. How do you display images that are burried in directories? For example, works with the image1 at same level but does not. nor does Any help would be apprechiated. Thanks in advance ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] images in directories
CURTIS David a écrit : > Hi, > I check the archives but could not find an answer. How do you display images that >are burried in directories? > For example, > works with the image1 at same level > but > does not. nor does > > Any help would be apprechiated. Thanks in advance You can use the tag on the folder IMAGES (because it's an object) like that : ... ... ... but it's a bit boring... ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] images in directories
David, Where image1 is in the folder IMAGES. -Aaron At 07:42 AM 11/2/00 -0800, CURTIS David wrote: >Hi, >I check the archives but could not find an answer. How do you display >images that are burried in directories? >For example, > works with the image1 at same level >but > does not. nor does > >Any help would be apprechiated. Thanks in advance > > > > >___ >Zope maillist - [EMAIL PROTECTED] >http://lists.zope.org/mailman/listinfo/zope >** No cross posts or HTML encoding! ** >(Related lists - > http://lists.zope.org/mailman/listinfo/zope-announce > http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] images in directories
When you create your image object set the path correctly then your should work :) Dan CURTIS David wrote: > > Hi, > I check the archives but could not find an answer. How do you display images that >are burried in directories? > For example, > works with the image1 at same level > but > does not. nor does > > Any help would be apprechiated. Thanks in advance > > > > ___ > Zope maillist - [EMAIL PROTECTED] > http://lists.zope.org/mailman/listinfo/zope > ** No cross posts or HTML encoding! ** > (Related lists - > http://lists.zope.org/mailman/listinfo/zope-announce > http://lists.zope.org/mailman/listinfo/zope-dev ) ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )