[Zope] Yet another way to insert a variable from an expression

Jaroslav Lukesh lsh@wo.cz
Fri, 12 Jul 2002 22:12:52 +0200


Toto je vícedílná zpráva formátu MIME.

------=_NextPart_000_01C229F1.4410BD00
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: Quoted-Printable

| Odes=EDlatel: DA Loeffler <David.Loeffler@bristol.ac.uk>
|=20
| <dtml-var expr=3D"_[id()+'.gif']" missing>

| <dtml-var "_.getattr(this().aq_parent, id() + '.gif')">

Genius! It works both, maybe complicated one will work better (restricted
acquisition), but...

| > > file1
| > > file1.gif
| > > file2
| > > file3
| > > file3.gif

But it does have error when filename does not have image filename.gif, li=
ke
file2

I was try dtml-if, dtml-let+dtml-if (and nested dtml-in - it does not wor=
k
because one is ObjectValue"DTML Document" and second is
ObjectValue"Image").

<dtml-if "_.string.find(_.getattr(this().aq_parent, id() + '.gif'),
'.gif')>0">

In attachment is a small file with my some tryouts (sorry, You do not an
idiot, but me :)

Many thanks

             Jaroslav Lukesh


------=_NextPart_000_01C229F1.4410BD00
Content-Type: application/octet-stream; name="sys_list-item.gz"
Content-Description: sys_list-item.gz (Aladdin StuffIt Archive)
Content-Disposition: attachment; filename="sys_list-item.gz"
Content-Transfer-Encoding: Base64

H4sICDQDLz0CAHN5c19saXN0LWl0ZW0AjZHNasMwEITPMeQdhC9yaOIEerUNLemtDaWUXkowirWO
VWzZkdbBfftKiX9CUtPetJpvVjurgGORL4Qk0FQqdMvdFyT4wfIatEfX7y/PZF0mdQES6cwlulQY
Ch45wdmWEjdj+lWVFSj89mgmOBguOsuQa4icyRhrbi3rTFriyBTRcKhBJrAQCEXvbRtNguw+GljJ
jiJ+fNhsnt6iYGmk8U4kLTDUqOoEawV8gdDggOeApNypOHTjTyo43ZI7Qv29SKl7uo+t4u8BGaLy
2CGumDILmRPBvVnPmihT0/IibuybJ4Xc+6mQ3LOd5h0brTq6GcHNKNZBt7eezmRjmpEttrXSHw37
BJgJ7c380SBXL97MZVc0p6aAJj7/YhiuDHe1vFun4L04xJo6QdXluoj172ldUgitzStdk2W7gG7B
bS1PdauaL7flwDq/HK3jB4Em7hsgAwAA

------=_NextPart_000_01C229F1.4410BD00--