[Zope] Using Image name like "foo.gif" w/o painful <dtml-with> problems?
Joel Burton
jburton@scw.org
Sun, 22 Jul 2001 18:11:56 -0400 (EDT)
Our site currently has images that have no .gif or .jpg at the end of
their ids. We're starting to use a clickthrough-analysis program that
tracks site usage, and assumes that all '.gif' and '.jpg' file are
graphics. Of course, to track site usage, it's important for the analysis
program to distinguish graphic requests from page requests.
We planned to rename all of our image file to __.gif, but because of the
overloaded meaning of the "." (as both separting objects &
methods/attributes, and as a file extensionn), it makes for very ugly
DTML -- something like:
<dtml-var "images.randompic.tag(hspace=10)">
has to become
<dtml-with images>
<dtml-with randompic.gif>
<dtml-var "tag(hspace=10)">
</dtml-with>
</dtml-with>
Or
<dtml-var "images['randompic.gif'].tag(hspace=10)">
which is better, but still as nice as the original.
Of course, we could make our own img tags, like:
<img src="/images/randompic.gif" hspace=10>
but then we lose the automagic titles, height, width, etc. that Zope can
provide.
On the plus side, having graphic files with "ordinary" extensions will let
us work a bit easier w/WebDAV and FTP, as some programs always expect file
to have these extensions.
So:
1) Is there any way to call a picture within a folder without the
twice-nested call above? Any workarounds?
2) Any other ideas on how to handle this? How do other sites deal with
this?
Any advice/help would be appreciated.
--
Joel Burton <jburton@scw.org>
Director of Information Systems, Support Center of Washington