[Zope] - Yet another stupid question: image folders

Phillip J. Eby pje@telecommunity.com
Mon, 07 Dec 1998 17:00:39 -0500


At 04:40 PM 12/7/98 -0500, Christopher G. Petrilli wrote:
>On Mon, Dec 07, 1998 at 04:35:43PM -0500, Phillip J. Eby wrote:
>> <!--#with images--><!--#var logo--><!--#/with-->
>
>This works, but I'm gonna whine that it's WAY too much typing :-)

Well, if you do this a lot, define a 'logo' document which contains it,
then everywhere else you'll only need to call it once.  If you want it to
be more dynamic, make a 'showSubImage' document and make it say:

<!--#with imgFolder--><!--#var "_[imgName]"--><!--#/with-->

And then call it with:

<!--#var "showSubImage(imgFolder=images,imgName='logo')"-->

Unfortunately, this is actually longer than the original 'with' version,
but at least it shows off some DTML hacking techniques.  :)


>Prefferable (though currently illegal) would be:
>
><!--#var logo with=images-->

Ugh.  Please don't go there.


>Somehow I think this could be useful for a lot of things... just don't
>ask me what else.  Alas, I think this is how Perl got the way it is.

Yep.  :)  Always be wary of taking an initially simple and clever idea and
then beating it to death with a dead horse, or something like that.  :)