22 Feb
2001
22 Feb
'01
8:40 p.m.
Hans de Wit writes:
.... <dtml-let foto="'/Cis/fotos/afoto.jpg'">
<dtml-if expr="_.getitem('foto')"> Keep in mind:
You cannot use URL-strings to access objects, neither as DTML name nor as parameter to "getitem"! In both contexts, they will be interpreted as an atomic name. Whenever you want to access an object through an URL, you will use "restrictedTraverse" (if the URL describes a physical path) or "REQUEST.resolve_url" (for virtual URL's). With these remarks, you can use: <dtml-if "_.hasattr(restrictedTraverse('/Cis/fotos'),'afoto.jpg')"> Dieter