13 Dec
2001
13 Dec
'01
10:11 p.m.
Todd Loomis writes:
I'm using the following code to create a page along with the following properties, however only the page is created the property isn't. What should I do:
<dtml-with "resources.test_forum.posts"> <dtml-call expr="addDTMLDocument(id=REQUEST['topic'], title=REQUEST['topic']) and manage_addProperty('name', REQUEST['poster'], 'string')"> </dtml-with> Your "manage_addProperty" operates on the current object and not the newly created one.
Use: <dtml-let newid="REQUEST['topic']"> <dtml-call expr="addDTMLDocument(id=newid,title=REQUEST['topic'])"> <dtml-with expr="_.getitem(newid)"> <dtml-call expr="manage_addProperty('name',REQUEST['poster'], 'string')"> </dtml-with> </dtml-let> Dieter