With above corrections, you're code should read:
This worked. Now, what if I need to assign again to the same variable:
<dtml-let Size="'big'"> <dtml-let Size="'bi'"> <dtml-if "Size=='big'"><h1></dtml-if> Hello. <dtml-if "Size=='big'"></h1></dtml-if> </dtml-let>
It complains about let tag not being closed. Do I need to nest let tags? It sounds silly...
I generally use the let tag for assigning more complex expressions to a variable. You cannot indeed change them without nesting let tags. However, you can lever the REQUEST object for this kind of thing: <dtml-call "REQUEST.set('Size', 'big')"> <dtml-call "REQUEST.set('Size', 'bi')"> <dtml-if "Size=='big'"><h1></dtml-if> Hello. <dtml-if "Size=='big'"></h1></dtml-if> Now, 'Size' is found in the REQUEST object, and there the value of 'Size' can be modified. -- Martijn Pieters, Software Engineer | Digital Creations http://www.digicool.com | Creators of Zope http://www.zope.org | mailto:mj@digicool.com ICQ: 4532236 | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 -------------------------------------------
However, you can lever the REQUEST object for this kind of thing: .... Now, 'Size' is found in the REQUEST object, and there the value of 'Size' can be modified.
Great! Is this in the docs? I found a very short article about dtml-call in DTML.7.html, but there's nothing about REQUEST.set... just a single example <dtml-call "addDocument('hi','display a greeting','Hello world!')"> Maybe there are other things I can do with <dtml-call>? -- Milos Prudek
participants (2)
-
Martijn Pieters -
Milos Prudek