Re: Random stuff on frontpage

2007-11-12 Thread Héctor Velarde
Espen Moe-Nilssen wrote: I made a template to show a random photo on the front page. As far as I understand, it is easy to use the same approach to show other random stuff (like a changing front-page in a "store", for example by setting the path to a smartfolder and using a macro to display a p

Re: Image Scales for a folderish AT

2007-11-12 Thread Héctor Velarde
Espen Moe-Nilssen wrote: I copied the field from ATImage, and "used that class" (this worked for "non-folderish"-type, here is the python code (I am prettty new to python) so, you didn't added the code I mentioned; try adding it... ___ Product-Devel

Re: Getting an image depending on a variable

2007-11-12 Thread Tom Lazar
On Nov 12, 2007, at 5:03 PM, Johannes Schwenk wrote: Hi all, I have the following problem: I want to get the width and height of an image in my pagetemplate. The thing is, it should be depending on a stored attribute. I would get the stored attribute like this in a TALES expression: image_siz

Re: download URLs for FileField should end with filename not fieldname

2007-11-12 Thread Tom Lazar
ah, of course! thanks encolpe, that was the nudge that i needed! cheers, tom On Nov 12, 2007, at 4:57 PM, Encolpe Degoute wrote: Tom Lazar a écrit : i already know how to retrieve the filename of the uploaded file, i want to know how it is possible to use it in a url so that the file is r

Random stuff on frontpage

2007-11-12 Thread Espen Moe-Nilssen
I made a template to show a random photo on the front page. As far as I understand, it is easy to use the same approach to show other random stuff (like a changing front-page in a "store", for example by setting the path to a smartfolder and using a macro to display a page. Thought I shoul

Getting an image depending on a variable

2007-11-12 Thread Johannes Schwenk
Hi all, I have the following problem: I want to get the width and height of an image in my pagetemplate. The thing is, it should be depending on a stored attribute. I would get the stored attribute like this in a TALES expression: image_size context/ImageSize; where image size is in ["full", "l

Re: download URLs for FileField should end with filename not fieldname

2007-11-12 Thread Encolpe Degoute
Tom Lazar a écrit : > i already know how to retrieve the filename of the uploaded file, i want > to know how it is possible to use it in a url so that the file is > returned when somebody uses such an url. > > i.e. instead of > > http://nohost/plone/foo/filedata It's http://nohost/plone/foo/*at_

Re: download URLs for FileField should end with filename not fieldname

2007-11-12 Thread Tim Hicks
Tom Lazar wrote: > thanks encolpe, > > however, i don't fully understand: > > On Nov 12, 2007, at 2:48 PM, Encolpe Degoute wrote: > >> If you can suppose that you never have two times the same filename used >> in a single document, > > yes, that's the case > >> you can iterate on schema and us

Re: download URLs for FileField should end with filename not fieldname

2007-11-12 Thread Tom Lazar
thanks encolpe, however, i don't fully understand: On Nov 12, 2007, at 2:48 PM, Encolpe Degoute wrote: If you can suppose that you never have two times the same filename used in a single document, yes, that's the case you can iterate on schema and use FileField.getFilename(self, instance

Re: download URLs for FileField should end with filename not fieldname

2007-11-12 Thread Encolpe Degoute
Tom Lazar a écrit : > has anybody got an idea how to have a download url for a FileField > attribute that includes the name of the uploaded file? > > currently, if an AT's FileField is named e.g. 'filedata' then all the > download links for that AT content type's file end in /filedata which is > c

download URLs for FileField should end with filename not fieldname

2007-11-12 Thread Tom Lazar
has anybody got an idea how to have a download url for a FileField attribute that includes the name of the uploaded file? currently, if an AT's FileField is named e.g. 'filedata' then all the download links for that AT content type's file end in /filedata which is confusing, when people dow

Re: Image Scales for a folderish AT

2007-11-12 Thread Espen Moe-Nilssen
Hi I copied the field from ATImage, and "used that class" (this worked for "non-folderish"-type, here is the python code (I am prettty new to python) ImageField("image", translation_mutator = """setTranslationImage""", pil_quality = 90, read_p