automatic dtml-methods
in a product i 'd like to create automated DTML-Methods, i do do this by: <dtml-in "propertysheets.Basic.propertyMap()" mapping> <dtml-call "REQUEST.set('FieldChangeAutoid', 'FormField'+id+'Change')"> <dtml-call "REQUEST.set('FieldChangeitem_title', 'Anzeige für add und change')"> <dtml-call "REQUEST.set('FieldChangeitem_body', '<input type=text name='+id+' value=<dtml-var '+id+'>>')"> <dtml-call "manage_addDTMLMethod(id=FieldChangeAutoid,title=FieldChangeitem_title,file=FieldChangeitem_body)"> </dtml-in> How can i use " " in FieldChangeitem_body ? what i need is to set the DTML-Method <input type="text" name="'+id+'" value="<dtml-var'+id+'>"> which needs "" as characters in the method but i can not set the ", i tried /" and i tried < Help!
"dorian" == dorian santner <dsantner@datasolutions.at> writes:
dorian> How can i use " " in FieldChangeitem_body ? Use the python '%' operator with slash quoted single quotes. Below I use 'dtml-let' rather than 'dtml-in' for demo, but I think this does what you want: <dtml-let myid="'jdh'"> <dtml-call "manage_addDTMLMethod( id='FormField%sChange' % myid, title='Anzeige für add und change', file='<input type=text name=\'%s\' value=%s>' % (myid, myid) )"> </dtml-let>
participants (2)
-
dorian santner -
John Hunter