How to skip processing the rest of a dtml document?
Hello all, I`m creating a dtml document with some if clauses embedded that returns a html page. But if one of de if clauses evaluates true, I like it returns for example a sentences displaying an error. Example code: <HTML> <HEAD> <dtml-if action> <dtml-if "action == 'insert line in order'"> ....some code that inserts a line in the order.... <dtml-elif "action == 'delete line from order'"> ....some code that deletes a line from the order.... <dtml-else> </HEAD> <BODY> Error. There is no action or action is incorrect. </BODY> </HTML> ......The dtml document must stop here. ....... </dtml-if> </dtml-if> </HEAD> <BODY> ....some code displaying the updated order.... </BODY> </HTML> The evaluation of ac must be in the HEAD tag. If ac doesn't exists then the order is displayed. Muy atentamente, Juan Carlos Coruña Director de Informática y Sistemas jcoruna@umd.es UMD S.A. UMD Bilbao, Oficina Central-Headquarters Ribera de Elorrieta 7 48015 BILBAO Tel: 902 128 256 / 94 476 29 93 Fax: +34 94 475 07 57 http://www.umd.es
Hi,
But if one of de if clauses evaluates true, I like it returns for example a sentences displaying an error. Try to use something like a flag:
<html> <head> <dtml-if expression1> <dtml-call "REQUEST.set('myFlag',1)"> ... do something ... </dtml-if> <dtml-if expression2> <dtml-call "REQUEST.set('myFlag',1)"> ... do some othe stuff ... </dtml-if> </head> <body> <dtml-if myFlag> Say something about expression1 or 2 ... <dtml-else> Say the other stuff ... </dtml-if> </body> </html> -- Robert Wohlfahrt (robert.wohlfahrt@sachsen-net.com) Tel: 0179 / 2980074 Fax: 0351 / 2880145
participants (2)
-
Juan Carlos Coruña -
Robert Wohlfahrt